This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new eb3d4bf875 Fix BZ 65995 - Use text/javascript rather than application/javascript eb3d4bf875 is described below commit eb3d4bf875962383471b0a6f069f00e26828dd1b 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 | 5 +++++ 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, 14 insertions(+), 9 deletions(-) diff --git a/conf/web.xml b/conf/web.xml index 68583546e6..00acceb763 100644 --- a/conf/web.xml +++ b/conf/web.xml @@ -2120,7 +2120,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 9994d5e91e..130ee41724 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 75782a1948..879c79f20e 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -112,6 +112,11 @@ support for the HTTP <code>PATCH</code> method as defined in RFC 5789. This is one of the changes in the Servlet 6.1 API. (markt) </add> + <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> <subsection name="Other"> diff --git a/webapps/docs/config/filter.xml b/webapps/docs/config/filter.xml index 6dee03d830..e26a48d87c 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