• Resolved Stephane PISKORZ

    (@stefanp44)


    Hi,

    I don’t have the words to deescribe how happy I was to find your plugin after having tested various Consent Management Platform. However, I get this error on some websites in the dev console “Refused to apply style from ‘…’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.

    I saw in the documentation that it was likely to be the uploads folder which would be protected or non-writable. It’s also when you protect your website with the X-content-Options with this line of code for instance :

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

    Is there any way at all to go around this, as I’m not ready to cut back on website security?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor jarnovos

    (@jarnovos)

    Hi @stefanp44,

    If the MIME type warning is related to the Cookie Banner stylesheet, I would expect that the Cookie Banner CSS file itself is not reachable when I visit its’ URL in the browser.

    But that seems to work fine on the attached website, and as your custom Cookie Banner styles appear correctly as well, perhaps it might concern another file in this case?

    I’ve additionally applied the same X-Content-Type-Options “nosniff” on my test site without this message getting logged as a result.

    Could you verify whether the error disappears when temporarily disabling Complianz?

    Kind regards, Jarno

    Thread Starter Stephane PISKORZ

    (@stefanp44)

    Hi @jarnovos ,

    Yes, same conclusion for me (and also I deactivated the Complianz CSS so that only the theme’s is used).

    I just deactivated Complianz and emptied the cache (both Redis and Wp Rocket), and there: no more errors ?? The error also disappears when I comment the “no sniffing” line in the htaccess.

    Perhaps I should try to exlude the css file from WP Rocket minify too?

    Plugin Contributor jarnovos

    (@jarnovos)

    Hi @stefanp44,

    Most-likely there is a server-side restriction that prevents the file from loading, this could be a redirect (to a 404 page, for example), but something else I can imagine would be that the server configuration (i.e in the .htaccess) doesn’t include the text/css MIME type, whereby the issue occurs after enabling the X-Content-Type-Options "nosniff" header.

    But as it’s seemingly related to the server configuration, it’s challenging for me to determine what the exact cause might be; especially as it does behave normally on a ‘standard’ server set-up on our end (and we have yet to receive similar reports about such issues).

    Kind regards, Jarno

    Thread Starter Stephane PISKORZ

    (@stefanp44)

    Hi @jarnovos ,

    I understand, I’ll try to test what causes this, I run several websites, some of them display this error, some of them don’t. And of course, they’re mostly built the same way… ?? Happy times coming investigating and testing…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Refused to apply style from’ is closed to new replies.