-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
X-Content-Type-Options blocking all css and js #3226
Comments
I'm sorry to hear your issue. I'm confused, though, ad that hear is only set for content we control, so I'm not sure why it would affect your own content. Can you help us reproduce the issue?
Thanks! |
@mohanen You can't set Content-Type properly? |
node v6.10.0 LTS run the attached aws labs sample app The resource from “http://127.0.0.1:3000/static/bootstrap/css/theme/flatly/bootstrap.css” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff). 127.0.0.1:3000 |
Hi @mohanen I don't see any code in your app that would actually serve up the files you listed above. All of those are giving 404 Not Found when I run your app, and since the 404 Not Found is HTML, it doesn't match the expected MIME type. Did you forget to add a |
Yea thanks that fixed the issue . Sorry for the wrong issue report , my bad. |
It's no problem, glad we were able to get to the root :) I'm not sure why the web browsers need to be so terse--just wait until you need to start using CORS :) |
Hi, where should i paste app.use('/static', express.static(__dirname + '/static')) ? Which file ? |
Hi @DamianRutkiewicz ,
You just need set up express to serve the static files like css/images/js etc... The Documentation explains clearly how to do it , You should take a look at it |
I am having the same issue with latest Chrome Version 65.0.3325.181 (Official Build) (64-bit) express.static does not return the right MIME type. Express Version : 4.16.2 / 2017-10-09 |
@mohanen can you reopen this issue? |
I'd like to add the following information as it may help new users searching for this issue: This is sort of a "404 Not Found" error message. Have a look at your browser's DevTools network request section and you'll see that the requested files simply have not been served by Express. |
X-Content-Type-Options is been set to nosniff in express libraries and i am not able to override em from my code , its completely blocking my css and js .
The text was updated successfully, but these errors were encountered: