-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
ValueError when If-Modified-Since is invalid for StaticFileHandler request #3408
Comments
Just discovered this as well! I'm looking for a workaround. Will comment again if I find one |
It's possible this is being trigged by a change in browser behavior. I am finding EDIT: Turns out that this has been a feature of our application for years—it's a cache buster—but we weren't passing these headers to tornado in the past. |
I agree that it should not be returning a 500 in this case. I would suggest the proper response is to return
|
Looks like @mcg1969 is correct, and invalid If-Modified-Since headers should be ignored instead of returning a 5xx or 4xx error. RFC 9110 section 13.1.3 says "A recipient MUST ignore the If-Modified-Since header field if the received field value is not a valid HTTP-date". |
Just coming over here to share that link! Thanks @bdarnell |
Fixed in #3412. |
Hello, recently our application underwent a security scan and I noticed our Tornado app was returning HTTP 500 for some requests:
Looks like
tornado.web.StaticFileHandler.should_return_304
is blindly parsing theIf-Modified-Since
header resulting in 500s. Ideally, invalid headers would return 400s.The text was updated successfully, but these errors were encountered: