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

StaticFile.fromFile ignores modified ETag if unmodified since #2529

Closed
ajluker opened this issue Apr 26, 2019 · 2 comments
Closed

StaticFile.fromFile ignores modified ETag if unmodified since #2529

ajluker opened this issue Apr 26, 2019 · 2 comments
Labels
enhancement Feature requests and improvements

Comments

@ajluker
Copy link

ajluker commented Apr 26, 2019

StaticFile.fromFile will return early with a 302 if the resource has not modified since, ignoring the request ETag. If the ETag provided in the If-None-Match header is different from that of the resource, a 302 should not be returned, regardless of the not modified since check.

As far as I understand from the spec, both conditions need to be checked before returning a 302:

If both an entity tag and a Last-Modified value have been
provided by the origin server, SHOULD use both validators in
cache-conditional requests.

This makes more sense if you consider rolling back a file to an older version, where the modification date is taken as when the version was authored, rather than when it was rolled back. Maybe this is unusual, although the above suggests it's covered in the spec and I just encountered it in the wild.

@ChristopherDavenport ChristopherDavenport added the enhancement Feature requests and improvements label Apr 26, 2019
@ajluker
Copy link
Author

ajluker commented Apr 26, 2019

Also, it looks like this code is incorrectly looking up the "ETag" response header from the request, rather than the client If-None-Match header.

@rossabaker
Copy link
Member

Fixed by #2571.

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

No branches or pull requests

3 participants