This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new a94459d811 Fix BZ 65995 - Use text/javascript rather than 
application/javascript
a94459d811 is described below

commit a94459d8117836eaa37eb245fe596b51954a969e
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Mar 2 09:07:44 2023 +0000

    Fix BZ 65995 - Use text/javascript rather than application/javascript
---
 conf/web.xml                                                 | 2 +-
 java/org/apache/catalina/filters/ExpiresFilter.java          | 4 ++--
 java/org/apache/catalina/startup/MimeTypeMappings.properties | 2 +-
 webapps/docs/changelog.xml                                   | 9 +++++++++
 webapps/docs/config/filter.xml                               | 2 +-
 webapps/examples/websocket/chat.xhtml                        | 2 +-
 webapps/examples/websocket/drawboard.xhtml                   | 2 +-
 webapps/examples/websocket/echo.xhtml                        | 2 +-
 webapps/examples/websocket/snake.xhtml                       | 2 +-
 9 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/conf/web.xml b/conf/web.xml
index f08832b820..86777073bb 100644
--- a/conf/web.xml
+++ b/conf/web.xml
@@ -2117,7 +2117,7 @@
     </mime-mapping>
     <mime-mapping>
         <extension>js</extension>
-        <mime-type>application/javascript</mime-type>
+        <mime-type>text/javascript</mime-type>
     </mime-mapping>
     <mime-mapping>
         <extension>jsf</extension>
diff --git a/java/org/apache/catalina/filters/ExpiresFilter.java 
b/java/org/apache/catalina/filters/ExpiresFilter.java
index ffdb07ce42..26deb4409e 100644
--- a/java/org/apache/catalina/filters/ExpiresFilter.java
+++ b/java/org/apache/catalina/filters/ExpiresFilter.java
@@ -95,7 +95,7 @@ import org.apache.juli.logging.LogFactory;
  *          <param-value>access plus 10 minutes</param-value>
  *       </init-param>
  *       <init-param>
- *          <param-name>ExpiresByType application/javascript</param-name>
+ *          <param-name>ExpiresByType text/javascript</param-name>
  *          <param-value>access plus 10 minutes</param-value>
  *       </init-param>
  *    </filter>
@@ -397,7 +397,7 @@ import org.apache.juli.logging.LogFactory;
  *    byType={
  *       image=ExpiresConfiguration[startingPoint=ACCESS_TIME, duration=[10 
MINUTE]],
  *       text/css=ExpiresConfiguration[startingPoint=ACCESS_TIME, duration=[10 
MINUTE]],
- *       
application/javascript=ExpiresConfiguration[startingPoint=ACCESS_TIME, 
duration=[10 MINUTE]]}]
+ *       text/javascript=ExpiresConfiguration[startingPoint=ACCESS_TIME, 
duration=[10 MINUTE]]}]
  * </code>
  * <p>
  * Sample of per-request log message where {@code ExpiresFilter} adds an 
expiration date
diff --git a/java/org/apache/catalina/startup/MimeTypeMappings.properties 
b/java/org/apache/catalina/startup/MimeTypeMappings.properties
index 84a7e331c4..f885260ee0 100644
--- a/java/org/apache/catalina/startup/MimeTypeMappings.properties
+++ b/java/org/apache/catalina/startup/MimeTypeMappings.properties
@@ -382,7 +382,7 @@ jpg=image/jpeg
 jpgm=video/jpm
 jpgv=video/jpeg
 jpm=video/jpm
-js=application/javascript
+js=text/javascript
 jsf=text/plain
 json=application/json
 jsonml=application/jsonml+json
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 99b747a74a..10cfdbfef8 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,15 @@
   issues do not "pop up" wrt. others).
 -->
 <section name="Tomcat 8.5.88 (schultz)" rtext="in development">
+  <subsection name="Catalina">
+    <changelog>
+      <fix>
+        <bug>65995</bug>: Implement RFC 9239 and use
+        <code>text/javascript</code> as the media type for JavaScript rather
+        than <code>application/javascript</code>. (markt)
+      </fix>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 8.5.87 (schultz)" rtext="Release in progress">
   <subsection name="General">
diff --git a/webapps/docs/config/filter.xml b/webapps/docs/config/filter.xml
index 708dd2a8fe..ec50d4a86a 100644
--- a/webapps/docs/config/filter.xml
+++ b/webapps/docs/config/filter.xml
@@ -529,7 +529,7 @@ HTTP/1.1 200 OK
     <param-value>access plus 10 minutes</param-value>
  </init-param>
  <init-param>
-    <param-name>ExpiresByType application/javascript</param-name>
+    <param-name>ExpiresByType text/javascript</param-name>
     <param-value>access plus 10 minutes</param-value>
  </init-param>
 </filter>
diff --git a/webapps/examples/websocket/chat.xhtml 
b/webapps/examples/websocket/chat.xhtml
index 806c172235..6c863feafa 100644
--- a/webapps/examples/websocket/chat.xhtml
+++ b/webapps/examples/websocket/chat.xhtml
@@ -42,7 +42,7 @@
             margin: 0;
         }
     ]]></style>
-    <script type="application/javascript"><![CDATA[
+    <script type="text/javascript"><![CDATA[
         "use strict";
 
         var Chat = {};
diff --git a/webapps/examples/websocket/drawboard.xhtml 
b/webapps/examples/websocket/drawboard.xhtml
index ccf0d382f6..245e41e318 100644
--- a/webapps/examples/websocket/drawboard.xhtml
+++ b/webapps/examples/websocket/drawboard.xhtml
@@ -69,7 +69,7 @@
         }
 
     ]]></style>
-    <script type="application/javascript"><![CDATA[
+    <script type="text/javascript"><![CDATA[
     "use strict";
 
     (function() {
diff --git a/webapps/examples/websocket/echo.xhtml 
b/webapps/examples/websocket/echo.xhtml
index ac2a732cf1..db3ce71606 100644
--- a/webapps/examples/websocket/echo.xhtml
+++ b/webapps/examples/websocket/echo.xhtml
@@ -49,7 +49,7 @@
             margin: 0;
         }
     ]]></style>
-    <script type="application/javascript"><![CDATA[
+    <script type="text/javascript"><![CDATA[
         "use strict";
 
         var ws = null;
diff --git a/webapps/examples/websocket/snake.xhtml 
b/webapps/examples/websocket/snake.xhtml
index f0dee271a9..a376a83ef1 100644
--- a/webapps/examples/websocket/snake.xhtml
+++ b/webapps/examples/websocket/snake.xhtml
@@ -57,7 +57,7 @@
     <div id="console-container">
         <div id="console"/>
     </div>
-    <script type="application/javascript"><![CDATA[
+    <script type="text/javascript"><![CDATA[
         "use strict";
 
         var Game = {};


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to