Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Correct JavaScript MIME types + extensions per RFC 9239

Mathias Bynens via nginx-devel
May 27, 2022 03:26AM
On Fri, May 27, 2022 at 1:55 AM Maxim Dounin <mdounin@mdounin.ru> wrote:

> Hello!
>
> On Mon, May 23, 2022 at 11:32:08AM +0200, Mathias Bynens via nginx-devel
> wrote:
>
> > Thank you, Maxim. Is there anything else I can do to help move this
> > along? The change is rather small and clearly follows the latest RFC,
> > so I would expect it to be uncontroversial.
>
> On the other hand, the RFC itself is rather controversial, as it
> changes preferred MIME type for javascript for no apparent reason,


Are you suggesting that RFCs can be published "for no apparent reason"? The
publication of this RFC ends a year-long cross-standard disagreement
between WHATWG/HTML & IETF/IANA. The controversy is finally over!

I don’t understand why nginx would willingly refuse to follow a now
universally-agreed up IETF standard. This patch has already landed in
apache/httpd, by the way.

and it adds the "mjs" extension, which is known to be mostly used
> in NodeJS-specific environments and was originally introduced with
> quite questionable claim that "on the web file extensions doesn't
> matter".
>

What do you think is questionable? It’s a fact that browsers do not care
about file extensions. (They care about MIME types and Content-Type HTTP
header.)

For example, https://mathiasbynens.be/ loads a JavaScript file at /js — no
extension. I could have named that file js.html or js.css or anything I
wanted, as long as I serve it with the proper Content-Type header, browsers
happily accept it.

Of course, file extensions are still useful for servers to send the proper
Content-Type header.


> I don't think we are in position to add the mjs extension, it does
> not seem to qualify as something commonly used on the web now.


What’s the harm in adding the extension mapping? If it’s not used, then
there’s no harm done.

The ticket referenced in the previous message can be used to track
> the request.
>
> As for the MIME type change from "application/javascript" to
> "text/javascript", this is something we'll consider as the outcome
> of the change suggested by the RFC becomes more clear.


What is unclear?


> For now,
> it looks like this might need more compatibility shims (such
> as adding both "text/javascript" and "application/javascript" to
> the default list of types handled by the charset module) and more
> changes (such as change of the MIME type used by autoindex with
> JSONP format).
>
> Hope this helps.
>
> --
> Maxim Dounin
> http://mdounin.ru/
> _______________________________________________
> nginx-devel mailing list -- nginx-devel@nginx.org
> To unsubscribe send an email to nginx-devel-leave@nginx.org
>
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[PATCH] Correct JavaScript MIME types + extensions per RFC 9239 Attachments

Mathias Bynens via nginx-devel 435 May 09, 2022 05:50AM

Re: [PATCH] Correct JavaScript MIME types + extensions per RFC 9239

Maxim Dounin 114 May 09, 2022 02:28PM

Re: [PATCH] Correct JavaScript MIME types + extensions per RFC 9239

Mathias Bynens via nginx-devel 162 May 23, 2022 05:34AM

Re: [PATCH] Correct JavaScript MIME types + extensions per RFC 9239

Maxim Dounin 95 May 26, 2022 07:20PM

Re: [PATCH] Correct JavaScript MIME types + extensions per RFC 9239

Mathias Bynens via nginx-devel 101 May 27, 2022 03:26AM

Re: [PATCH] Correct JavaScript MIME types + extensions per RFC 9239

Maxim Dounin 125 May 27, 2022 12:02PM

Re: [PATCH] Correct JavaScript MIME types + extensions per RFC 9239

Mathias Bynens via nginx-devel 108 May 25, 2022 03:26AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 270
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready