cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Roebuck <>
Subject [C2] [Patch] - setContentType()
Date Sat, 03 Mar 2001 16:40:07 GMT
The revision of has introduced a problem on my setup.  I include
a patch which fixes the problem for me, but I make no claims to know the surrounding code,
so I may only be dealing with the symptoms!

The impact of this for me was that javascript files were not being served properly to *most*
web browsers.  The exception was Internet Explorer on MacOS X Beta.  So I assume this is somehow
tied up with the nature of the HTTP request.

The direct symptom was a null pointer exception when setting the content type. It looks like
the newly introduced setting of content type doesn't account for situations when getMimeType
may return a null value.

Here's the patch:

Index: src/org/apache/cocoon/reading/
RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/reading/Attic/,v
retrieving revision
diff -u -r1.1.2.20
--- src/org/apache/cocoon/reading/	2001/02/23 21:36:37
+++ src/org/apache/cocoon/reading/	2001/03/03 16:32:14
@@ -132,7 +132,8 @@
             byte[] buffer = new byte[(int)len];
-            res.setContentType(this.getMimeType());
+            final String mimeType = this.getMimeType();
+            if (mimeType != null) res.setContentType(this.getMimeType());
             long expires = parameters.getParameterAsInteger("expires", -1);

View raw message