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

Incorrect mime-type for configuration.js #241

Closed
nebulade opened this issue Dec 7, 2023 · 4 comments · Fixed by #243
Closed

Incorrect mime-type for configuration.js #241

nebulade opened this issue Dec 7, 2023 · 4 comments · Fixed by #243

Comments

@nebulade
Copy link

nebulade commented Dec 7, 2023

Hi, first of all thanks for the great app! I am currently packaging it for Cloudron and came across an issue, where our reverse proxy in front of the app sets X-Content-Type-Options: nosniff which results in the browser refusing to use for example .js files which have the wrong content-type header. The first such issue I came across was the configuration.js route which is delivered as text/html.

For example firefox will report as:

The resource from “https://cal.domain.com/configuration.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

I am not a python developer or know flask much, but is there a way to set the content type correctly or am I totally on the wrong path here?

Potentially other routes also have the wrong mime-type, will get to that later if any.


We're using Polar.sh so you can upvote and help fund this issue. We receive the funding once the issue is completed & confirmed by you. Thank you in advance for helping prioritize & fund our work. Fund with Polar
@niccokunzmann
Copy link
Owner

niccokunzmann commented Dec 11, 2023

Thanks for spotting this! Yes, the content type should be relatively easy to set... I will have a look.

Can you share the cloudron configuration? I am interested :) #143

@niccokunzmann
Copy link
Owner

I created this to correctly set the mime type in flask automatically. However some are not set on OWC side - not flasks fault.

niccokunzmann added a commit that referenced this issue Dec 11, 2023
check content type of JS files
niccokunzmann added a commit that referenced this issue Dec 11, 2023
check content type of JS files
@niccokunzmann
Copy link
Owner

niccokunzmann commented Dec 11, 2023

Hi @nebulade, I set the content type in #243 and merged it into master. Please check if that works for you! If it does, you can close the issue.

@niccokunzmann niccokunzmann reopened this Dec 11, 2023
@nebulade
Copy link
Author

Great, thanks for the fast fix. I've just built an app package from that sha and it works as expected!

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

Successfully merging a pull request may close this issue.

2 participants