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

Some static files are not served with Flask 2.0 #113

Closed
encukou opened this issue Jun 1, 2021 · 5 comments · Fixed by #115
Closed

Some static files are not served with Flask 2.0 #113

encukou opened this issue Jun 1, 2021 · 5 comments · Fixed by #115

Comments

@encukou
Copy link
Contributor

encukou commented Jun 1, 2021

Flask 2.0 seems to have made changes around serving static files, and Frozen-Flask's approach no longer finds all static files.

See also: #112 (comment), #111 (comment)

@jayaddison
Copy link
Contributor

Working on a little more confirmation here, but it looks like this may relate to pallets/flask#3762 (included in Flask 2.x).

We use a test at

if unwrap_method(view) is send_static_file:
yield rule.endpoint
to check whether each view function is the same as the send_static_file method, and yield the matching endpoint names.

With the introduction of the lambda function 'in front' of the send_static_file method, the equality check will not pass, the static endpoint is skipped from the list of Frozen-Flask static rules, and the contents aren't retrieved for freezing into the resulting document set.

@jayaddison
Copy link
Contributor

Because it didn't seem clear how Flask-Frozen could fix this easily, I thought it might be worth asking the flask community whether they have any ideas or suggestions.

This has been opened as a GitHub discussion (filed as Q&A) here: pallets/flask#4136

@honzajavorek
Copy link
Contributor

Hi @jayaddison, this is amazing work, thank you so much! I haven't had much time lately to assist here, I'm sorry for that.

@jayaddison
Copy link
Contributor

No problem at all @honzajavorek; thanks for maintaining the library. I'd offer some time if I could, but not sure I can promise much; I'll try to check in on the health of frozen-flask when possible.

@honzajavorek
Copy link
Contributor

I'd be happy to see you around! Thank you for the work on this issue, I think that was already an excellent way how you helped this project :)

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