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

make etag a strong etag when used in if-None-Match #1480

Open
moafak opened this issue Dec 27, 2017 · 1 comment
Open

make etag a strong etag when used in if-None-Match #1480

moafak opened this issue Dec 27, 2017 · 1 comment

Comments

@moafak
Copy link

moafak commented Dec 27, 2017

Should restangular make the etag it receives a strong etag when it sends it as if-None-Match http header
(i.e strip the W/ from received etag when it uses it as if-None-Match)

MDN says that <etag_value>

may be prefixed by W/ to indicate that the weak comparison algorithm should be used (This is useless with If-None-Match as it only uses that algorithm).

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match

for more context: https://stackoverflow.com/questions/47995118/nginx-doesnt-match-weak-etags

I'm trying to handle weak etags problem with nginx
If I send a weak etag (with W/"<etag>"), nginx will not recognize the etag, and will send 200 OK http response
But If I send it as strong etag (without W/"<etag>") then nginx will respond correctly with 304 Not Modified response

@meastman
Copy link

That would certainly seem like an nginx bug.

https://tools.ietf.org/html/rfc7232#section-3.2
"A recipient MUST use the weak comparison function when comparing entity-tags for If-None-Match"

https://tools.ietf.org/html/rfc7232#section-2.3.2
"Weak comparison: two entity-tags are equivalent if their opaque-tags match character-by-character, regardless of either or both being tagged as "weak"."

Also, it looks like this may have been fixed in nginx 1.7.3:
http://hg.nginx.org/nginx/rev/af229f8cf987 "Entity tags: weak comparison for If-None-Match."
nginx/nginx@release-1.7.2...release-1.7.3

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

No branches or pull requests

2 participants