remm        2002/09/18 06:16:39

  Modified:    catalina/src/share/org/apache/catalina/servlets
                        DefaultServlet.java
  Log:
  - Relax the writer use policy to allow including files with unknown
    MIME types, which in that case will be assumed to be text. This is to make
    Tomcat more user friendly, although this has potential for some misuse.
  - Patch submitted by Tim Funk <funkman at joedog.org>
  
  Revision  Changes    Path
  1.58      +6 -6      
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java
  
  Index: DefaultServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- DefaultServlet.java       14 Jun 2002 03:19:43 -0000      1.57
  +++ DefaultServlet.java       18 Sep 2002 13:16:39 -0000      1.58
  @@ -1023,8 +1023,8 @@
               } catch (IllegalStateException e) {
                   // If it fails, we try to get a Writer instead if we're
                   // trying to serve a text file
  -                if ( (contentType != null)
  -                     && (contentType.startsWith("text")) ) {
  +                if ( (contentType == null)
  +                     || (contentType.startsWith("text")) ) {
                       writer = response.getWriter();
                   } else {
                       throw e;
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to