hint icon indicating copy to clipboard operation
hint copied to clipboard

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

Open laukstein opened this issue 3 years ago • 2 comments

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.

laukstein avatar Dec 09 '21 22:12 laukstein

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?

captainbrosset avatar Feb 09 '22 13:02 captainbrosset

@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).

antross avatar Feb 16 '22 22:02 antross