You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently tested upgrading an application from flask 1.1.4 to flask 2.1.1. After the upgrade I found this weird behavior where requests to static files fail if they have the If-Modified-Since header set to a date later than the creation time of the requested file.
To reproduce, simply create a minimal flask application (as below), create a test file in static/ and request the file with If-Modified-Since set to a date in the future.
I'm not sure if it is a flask or a werkzeug issue, so I apologize if this is reported in the incorrect place.
from flask import Flask
app = Flask(__name__)
Environment:
Python version: 3.8.9
Flask version: 2.1.1
The text was updated successfully, but these errors were encountered:
Can you test this with the latest 2.1.x branch? I just fixed sending Content-Disposition for 304 and removed buggy keep-alive connections. I can't reproduce this issue now, have a feeling they were all related. I'll release 2.1.2 soon.
I recently tested upgrading an application from flask 1.1.4 to flask 2.1.1. After the upgrade I found this weird behavior where requests to static files fail if they have the If-Modified-Since header set to a date later than the creation time of the requested file.
This is causing issues in Chrome where the requested resources will not load. I found a few recent posts on stackoverflow that presents the same issue:
https://stackoverflow.com/questions/71886534/chrome-fails-to-load-some-scripts-stylesheets-with-err-invalid-http-response
https://stackoverflow.com/questions/71890593/python-flask-304-response-on-reload
Here is the output of curl showing a working and non-working request demonstrating this behavior:
To reproduce, simply create a minimal flask application (as below), create a test file in static/ and request the file with If-Modified-Since set to a date in the future.
I'm not sure if it is a flask or a werkzeug issue, so I apologize if this is reported in the incorrect place.
Environment:
The text was updated successfully, but these errors were encountered: