tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1139280 - in /tomcat/trunk: java/org/apache/catalina/servlets/DefaultServlet.java webapps/docs/changelog.xml
Date Fri, 24 Jun 2011 12:48:21 GMT
Author: rjung
Date: Fri Jun 24 12:48:20 2011
New Revision: 1139280

URL: http://svn.apache.org/viewvc?rev=1139280&view=rev
Log:
Fix IllegalStateException for JavaScript files
when switching from Writer to OutputStream.

The special handling of this case in the
DefaultServlet was broken due to a MIME type
change for JavaScript.

Modified:
    tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java?rev=1139280&r1=1139279&r2=1139280&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java Fri Jun 24 12:48:20
2011
@@ -877,7 +877,8 @@ public class DefaultServlet
                 // trying to serve a text file
                 if ( (contentType == null)
                         || (contentType.startsWith("text"))
-                        || (contentType.endsWith("xml")) ) {
+                        || (contentType.endsWith("xml"))
+                        || (contentType.contains("/javascript")) ) {
                     writer = response.getWriter();
                     // Cannot reliably serve partial content with a Writer
                     ranges = FULL;

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1139280&r1=1139279&r2=1139280&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Jun 24 12:48:20 2011
@@ -142,6 +142,12 @@
       <update>
         Improve JMX unit test. (rjung)
       </update>
+      <fix>
+        Fix IllegalStateException for JavaScript files when switching from
+        Writer to OutputStream. The special handling of this case in the
+        DefaultServlet was broken due to a MIME type change for JavaScript.
+        (funkman)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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


Mime
View raw message