1

In magento when I add to cart the product I show below error:

"Refused to execute script from 'http://www.example.com/ajaxcartsuper/ajaxcart/add/uenc/aHR0cDovL215ZmF…r_attribute%5B139%5D=27&qty=1&product=377&related_product=&_=1478249505680' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled."

  • Thanks for the answer but for my site (Magento 2) I can't see these lines for the .htaccess file, so how can I fix it? could you please help me out it to resolve. – R008magento May 1 '18 at 7:31
6

Yes I solved it: I just put the below line to my htaccess file than it works good in chrome as well as other browser

<IfModule mod_headers.c>
Header always set X-Content-Type-Options nosniff    
</IfModule>
1

I have same issue and when i checked root .htaccess file then that code already exist and i have comment that and its working fine.

 <IfModule mod_headers.c>
        # Header set X-Content-Type-Options: nosniff
 </IfModule>

If your server adds the X-Content-Type-Options header when serving the *.js files, it will force some browsers such as Chrome to perform strict checking of MIME types.

X-Content-Type-Options: nosniff

So, Remove this header to prevent browsers to performing the MIME check.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.