-
Notifications
You must be signed in to change notification settings - Fork 119
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
Webbundle should set mimetype of config.js correctly #248
Comments
@ftsell does this issue happens only if config.js is invalid javascript right? We never saw such issue with a valid config.js so I'm not sure if this is the real issue. |
No the validity of Basically the Browser is trying to figure out as what to treat the received HTTP-Response. Normally it would look at the And in this circumstance neither sniffing nor a server-defined MIME-Type is available so the Browser treats Mozilla explains this in their article about MIME-Type in more detail. |
@ftsell but are you using a custom config.js? By default no config.js is provided and everything works correctly. config.js is needed only under some special circumstances. Can you provide a way to reproduce this issue? |
No I am not using a custom config.js. And testing things with a locally running agola server works for me as well because then the If you want to, you can check out the browser console when visiting my deployed instance over at agola-ci.finn-thorben.me In this Gist you can also find the exact deployment config I am currently using (on Kubernetes). |
@ftsell thanks. So probably our production webserver is not setting that header. Would you like to open a pull request? |
I'm working on a PR as we speak ;) |
What happened:
When opening the Web-UI, only a blank page showed.
What you expected to happen:
The Web-UI should work as expected or at least show an error that it's config could not be loaded.
How to reproduce it (as minimally and precisely as possible):
X-Content-Type-Options: nosniff
on your webserverAnything else we need to know?:
When the X-Content-Type-Option nosniff is set, it instructs browsers to not guess any content MIME-Types and since the
/config.js
route does not define its content to be Javascript, it does not get interpreted as such.Setting the response header
Content-Type
toapplication/javascript
below should fix this problem:agola/internal/services/gateway/handlers/webbundle.go
Lines 71 to 76 in 94462e6
Environment:
The text was updated successfully, but these errors were encountered: