webhintio / hint

💡 A hinting engine for the web
https://webhint.io/
Apache License 2.0
3.63k stars 685 forks source link

[Bug] Should recommend text/javascript and not application/javascript #4946

Open laukstein opened 2 years ago

laukstein commented 2 years ago

Hints shows Content-Type error

'content-type' header media type value should be 'application/javascript', not 'text/javascript'.

grabilla g15736

pointing to article https://webhint.io/docs/user-guide/hints/hint-content-type/#a-note-about-applicationjavascript saying totally opposite

This hint recommends using a Content-Type of text/javascript for JavaScript resources as noted in the HTML standard.

captainbrosset commented 2 years ago

Related: https://github.com/webhintio/hint/issues/2621 Funny how confusing this content-type can be! Even webhint doesn't agree with itself about it 😁

@antross can you help shade some light on which is correct here, the docs or the hint?

antross commented 2 years ago

@captainbrosset, per #2621 we should be allowing either, so something's definitely gone awry 🤔 I'm wondering if we picked up a dependency update that altered this (though it should have been caught by tests in theory).

Thanks for the report @laukstein - we'll see if we can figure out what's up. In the meantime, if you have a live URL we can repro this on that'd be helpful (otherwise we'll try to set up a test page later).