Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different ETag vs. OC-ETag handling in sync-client #3946

Closed
ghost opened this issue Oct 13, 2015 · 10 comments
Closed

Different ETag vs. OC-ETag handling in sync-client #3946

ghost opened this issue Oct 13, 2015 · 10 comments

Comments

@ghost
Copy link

ghost commented Oct 13, 2015

Hi,

currently updating the nginx config for oC 8.1/8.2 in owncloud-archive/documentation#1320 and planned to remove the gzip off; statement in there as oC 8.1.x has introduced the OC-ETag header.

My question is if the client able to handle a different ETag without any issues?

If gzip off; is used the server replies with the following response:

HTTP/1.1 200 OK
Server: nginx
Date: Tue, 13 Oct 2015 11:34:25 GMT
Content-Type: text/plain;charset=UTF-8
Content-Length: 56896
Connection: keep-alive
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *; connect-src *
Set-Cookie: 525469084e7d1=jb310a2tnaiv1thrkmp0q29mh3; path=/; secure; HttpOnly
Last-Modified: Tue, 13 Oct 2015 11:33:53 GMT
ETag: "6ebe2886830227ff37107c5253f56ded"
Content-Disposition: attachment
OC-ETag: "6ebe2886830227ff37107c5253f56ded"
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-Robots-Tag: none
Strict-Transport-Security: max-age=15768000

where a gzip on; is showing:

HTTP/1.1 200 OK
Server: nginx
Date: Tue, 13 Oct 2015 11:35:24 GMT
Content-Type: text/plain;charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *; connect-src *
Set-Cookie: 525469084e7d1=mb7oc53fbs41nf4gqda46i6g03; path=/; secure; HttpOnly
Last-Modified: Tue, 13 Oct 2015 11:33:53 GMT
ETag: W/"6ebe2886830227ff37107c5253f56ded"
Content-Disposition: attachment
OC-ETag: "6ebe2886830227ff37107c5253f56ded"
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-Robots-Tag: none
Strict-Transport-Security: max-age=15768000
Content-Encoding: gzip

Note the difference between:

ETag: "6ebe2886830227ff37107c5253f56ded"
OC-ETag: "6ebe2886830227ff37107c5253f56ded"

and

ETag: W/"6ebe2886830227ff37107c5253f56ded"
OC-ETag: "6ebe2886830227ff37107c5253f56ded"

The requests above where done with:

curl -I -sH 'Accept-encoding: gzip' --user test:test https://example.com/remote.php/webdav/test.txt

@ckamm
Copy link
Contributor

ckamm commented Oct 14, 2015

@RealRancor The client will always prefer the OC-ETag header. It also logs a message if it's different from ETag. The header parsing already strips out a trailing "-gzip", it seems we might also want to strip the W/ prefix for weak etags...

@ghost
Copy link
Author

ghost commented Oct 14, 2015

@ckamm Great, thanks for the info. So i think its save to remove the gzip off; from the nginx config.

@guruz
Copy link
Contributor

guruz commented Oct 15, 2015

@RealRancor Thanks for the initiative.
But what about Android and iOS?

@rperezb

@ghost
Copy link
Author

ghost commented Oct 15, 2015

@guruz

Ahhh, good point. Havn't thought about the Apps.

ckamm added a commit that referenced this issue Oct 15, 2015
@ckamm
Copy link
Contributor

ckamm commented Oct 15, 2015

@RealRancor The client also supports weak etags now. :)

@ckamm ckamm closed this as completed Oct 15, 2015
@ghost
Copy link
Author

ghost commented Oct 15, 2015

@ckamm Great, thanks.

@ckamm @guruz Do you know who could answer the question if the Android and iOS app are also supporting the OC-ETag header?

@guruz
Copy link
Contributor

guruz commented Oct 15, 2015

@rperezb @davitol @davivel might know..

@javiergonzper
Copy link

On iOS we are not using the "OC-Etag" we are just using the "ETag".
Should we start to use "OC-Etag"?

PD: @guruz thanks for remember the mobile apps 😉

@davivel
Copy link

davivel commented Oct 15, 2015

@RealRancor , in Android the preference for "OC-Etag" and the removal of "-gzip" suffix will be introduced with the next release - hopefully in the middle of November. It's part of owncloud/android#1109

@ghost
Copy link
Author

ghost commented Oct 15, 2015

@davivel Great, thanks for the info.

@javiergonzper I think it makes sense. A lot of serves configs out there will strip the ETag away or modify it so the "normal" ETag is not always reliable. Thats why oC 8.1 has introduced this new OC-ETag header.

So for know i keep the gzip off in the nginx config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants