You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2022/04/06 13:48:33 UTC

[Bug 65995] New: Change JavaScript MIME type from application/javascript to text/javascript

https://bz.apache.org/bugzilla/show_bug.cgi?id=65995

            Bug ID: 65995
           Summary: Change JavaScript MIME type from
                    application/javascript to text/javascript
           Product: Tomcat 8
           Version: 8.5.78
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: alexanderv@gmx.net
  Target Milestone: ----

The default MIME type for JavaScript in Tomcat is application/javascript. This
has been obsoleted and should be replaced with text/javascript.

Ref.:
https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/17/
https://www.iana.org/assignments/media-types/media-types.xhtml#application

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 65995] Change JavaScript MIME type from application/javascript to text/javascript

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65995

--- Comment #7 from ryodan <th...@fthcapital.com> ---
https://docs.astro.columbia.edu/search?q=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://pwonline.ru/forums/fredirect.php?url=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://www.oculus.com/lynx_warn/?u=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://tributes.smh.com.au/obituaries/435378/mark-daniel-coughlan/?r=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://book.douban.com/link2/?url=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://med.jax.ufl.edu/webmaster/?url=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://bbs.vivo.com/in/link?target=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://guru.sanook.com/?URL=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://prezi.com/url/?target=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://left.engr.usu.edu/chanview?f=&url=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://www.figma.com/exit?url=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://go.soton.ac.uk/public.php?format=simple&action=shorturl&url=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://minecraft.curseforge.com/linkout?remoteUrl=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://captcha.2gis.ru/form?return_url=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://forums.botanicalgarden.ubc.ca/proxy.php?link=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://info.scvotes.sc.gov/Eng/OVR/Help.aspx?returnLink=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://sdx.microsoft.com/krl/addurlconfirm.aspx?OS=6.1.7601&SP=1.0&ClientVer=15.4.3555.0308&type=ots&url=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://www.crunchyroll.com/fr/external_redirect?url=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://sd39.senate.ca.gov/sites/sd39.senate.ca.gov/files/outreach/common/sd39-atkins-redirect.php?URL=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
https://ecms.des.wa.gov/ECMSUserManager/ForgotPassword.aspx?system=5&startURL=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
http://mel.ess.ucla.edu/radarwiki/api.php?action=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime
http://ufldl.stanford.edu/wiki/api.php?action=https://community.wongcw.com/blogs/171924/All-You-Want-To-Know-About-Gogoanime

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 65995] Change JavaScript MIME type from application/javascript to text/javascript

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65995

matthias.keller@ergon.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matthias.keller@ergon.ch

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 65995] Change JavaScript MIME type from application/javascript to text/javascript

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65995

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
Moving this to NEEDINFO as it seems to best reflect the current state of
waiting for the RFC to be published.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 65995] Change JavaScript MIME type from application/javascript to text/javascript

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65995

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Mark Thomas <ma...@apache.org> ---
Fixed in:
- 11.0.x for 11.0.0-M5 onwards
- 10.1.x for 10.1.8 onwards
-  9.0.x for  9.0.74 onwards
-  8.5.x for  8.5.88 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 65995] Change JavaScript MIME type from application/javascript to text/javascript

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65995

--- Comment #5 from Alexander Veit <al...@gmx.net> ---
This change is also in accordance with RFC 9239:

'IANA has added the note "OBSOLETED in favor of text/javascript"
to all registrations except "text/javascript"; that is, this note
has been added to the "text/ecmascript", "application/javascript",
and "application/ecmascript" registrations.'

https://www.rfc-editor.org/rfc/rfc9239.html

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 65995] Change JavaScript MIME type from application/javascript to text/javascript

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65995

--- Comment #6 from Alex Melnikov <al...@gmail.com> ---
Hello!

I'm wondering why this change also breaks existing applications setting
Content-Type to 'application/javascript'. I'm totally agree that Tomcat should
not use obsolete mime types.

I can understand if Tomcat prints a warning about obsolete mime type, but in
our case Tomcat returns http response code 406 and not returning response body.

For us it not critical, we can update our code. But for some other people this
can trigger more problems.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 65995] Change JavaScript MIME type from application/javascript to text/javascript

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65995

--- Comment #1 from Konstantin Kolinko <kn...@gmail.com> ---
(In reply to Alexander Veit from comment #0)
> Ref.:
> [1] https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/17/
> [2] https://www.iana.org/assignments/media-types/media-types.xhtml#application

Some notes.

1. The IETF document [1] is a draft, but looking at its "History" [3] tab, it
has been approved.

> 2022-03-02 - IESG has approved the document
> 2022-03-02 - IESG state changed to Approved-announcement sent

The document is currently in a queue [4] to be published.

[3]
https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/history/
[4]
https://www.rfc-editor.org/current_queue.php#draft-ietf-dispatch-javascript-mjs

2. The IETF Draft mentions (in "6.") that the HTML specification already uses
"text/javascript" as the default media type.

That essentially refers section "4.12.1.1 Processing model" of the HTML
Specification. [5]

[5]
https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model

3. Looking at the HTML specification, one can see the following text in section
"4.12.1.2 Scripting languages" [6]:

> Servers should use text/javascript for JavaScript resources.

[6] https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages


4. The IETF Draft also mentions a new file extension ".mjs" is being
registered.


5. Apache Tomcat generally follows Apache HTTP Server in its mime-type
mappings.

One can see that the configuration file "conf/mime.types" in Apache HTTP Server
project has not been updated yet.

Both in the trunk version [7] (last updated in December 2020), and on the 2.4.x
branch [8] (last updated 4 years ago) as well.

[7] https://svn.apache.org/viewvc/httpd/httpd/trunk/docs/conf/
[8] https://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/conf/


6. Personally, it is odd to me to read that "text/javascript" is more popular
than "application/javascript", despite RFC4329 [9] that suggested otherwise,
despite all popularity of Apache HTTP Server and "application/javascript" being
the default configuration.

My guess is that "text/javascript" is popular as a value of the type attribute
of <script> tag of HTML (not only thanks to HTML 5 specification, but the
previous HTML 4 as well [10]), but hardly anyone cares what Content-Type is
used when sending a js file over the wire.

[9] https://datatracker.ietf.org/doc/html/rfc4329
[10] https://www.w3.org/TR/html401/interact/scripts.html


Overall, I see that there are grounds to make the change. I would like to wait
for the official publication of the document by IETF, and RFC4329 [9] being
declared as obsolete.

Also it looks that we can add a mime-mapping for "mjs" to be "text/javascript"
at the same time.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 65995] Change JavaScript MIME type from application/javascript to text/javascript

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65995

--- Comment #2 from Christopher Schultz <ch...@christopherschultz.net> ---
I agree we should wait for publication of that standard to change the default
mapping. Anyone can change this themselves at any point, of course.

RFC 4329 specifically (a) defines text/javascript and text/ecmascript and (b)
immediately obsoletes them[1]. LOL.

I think text/javascript is superior to application/javascript because
application/* MIME types are not supposed to have charset parameters.

On the other hand, Mozilla says serving with a charset parameter is practically
prohibited[2].

So I guess we go back to BOMs and <script charset=""> which is totally stupid.

[1] https://www.rfc-editor.org/rfc/rfc4329.html#section-3
[2]
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#textjavascript

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org