prussell    01/03/03 09:17:24

  Modified:    src/org/apache/cocoon/reading Tag: xml-cocoon2
                        ResourceReader.java
  Log:
  Stopped ResourceReader setting the response content type when getContentType
  returns null. Thanks to Stuart Roebuck for spotting this.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.21  +7 -2      
xml-cocoon/src/org/apache/cocoon/reading/Attic/ResourceReader.java
  
  Index: ResourceReader.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon/src/org/apache/cocoon/reading/Attic/ResourceReader.java,v
  retrieving revision 1.1.2.20
  retrieving revision 1.1.2.21
  diff -u -r1.1.2.20 -r1.1.2.21
  --- ResourceReader.java       2001/02/23 21:36:37     1.1.2.20
  +++ ResourceReader.java       2001/03/03 17:17:21     1.1.2.21
  @@ -38,7 +38,7 @@
   /**
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.20 $ $Date: 2001/02/23 21:36:37 $
  + * @version CVS $Revision: 1.1.2.21 $ $Date: 2001/03/03 17:17:21 $
    *
    * The <code>ResourceReader</code> component is used to serve binary data
    * in a sitemap pipeline. It makes use of HTTP Headers to determine if
  @@ -132,7 +132,12 @@
               byte[] buffer = new byte[(int)len];
               is.read(buffer);
               is.close();
  -            res.setContentType(this.getMimeType());
  +            
  +            String mimeType = this.getMimeType();
  +            if (mimeType != null) {
  +                res.setContentType(mimeType);
  +            }
  +            
               res.setContentLength(buffer.length);
               long expires = parameters.getParameterAsInteger("expires", -1);
   
  
  
  

Reply via email to