javascriptcssnode.jsheaderx-content-type-options

Problem with X-Content-Type-Options in node.js


I'm working on a To-Do List project with node.js and I met a problem with the header X-Content-Type-Options in my browser console which prevent myself from reading stylesheet or javascript script.

To give you an idea, here the screen capture: enter image description here

I tried to relsolve this problem by adding a .htaccess file in my project but there is nothing to do. Here what I put in my file:

Header always set X-Content-Type-Options "nosniff"

Thank you so much in advance


Solution

  • I finally resolved my problem: in fact, in the ejs ' header document where we put the link, I should have added the access path to server.

    So I put: Same thing for the javascript file.