This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new 2506a9826f Fix BZ 65995 - Use text/javascript rather than application/javascript 2506a9826f is described below commit 2506a9826fa8b9d9ad273fa78976ab08cb24ae20 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 d0d4f3150e..ddabd5efa9 100644 --- a/conf/web.xml +++ b/conf/web.xml @@ -2124,7 +2124,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 9b8b86bfb5..b8f6afb1a6 100644 --- a/java/org/apache/catalina/filters/ExpiresFilter.java +++ b/java/org/apache/catalina/filters/ExpiresFilter.java @@ -92,7 +92,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> @@ -394,7 +394,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 215a5ea459..f0b52f9fe7 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 9.0.74 (remm)" 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 9.0.73 (remm)" 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 a2edf3c71b..7702ef97e9 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