Bug 35899 - Compression, noCompressionUserAgents and no user-agent header causes crash
Summary: Compression, noCompressionUserAgents and no user-agent header causes crash
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Connector:HTTP (show other bugs)
Version: 5.0.30
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-27 17:17 UTC by Chris Wilson (Aptivate)
Modified: 2005-09-22 08:27 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Wilson (Aptivate) 2005-07-27 17:17:28 UTC
When compression is enabled like so: 
 
    <Connector  port="8130" 
                maxThreads="150" minSpareThreads="25" maxSpareThreads="75" 
                enableLookups="false" redirectPort="8443" acceptCount="100" 
                debug="0" connectionTimeout="20000" 
                disableUploadTimeout="true" 
                compression="on" 
                compressionMinSize="2048" 
                noCompressionUserAgents="gozilla, traviata" 
                compressableMimeType="text/html,text/xml" /> 
 
and a request with no User-Agent is sent, Tomcat dies with a 
java.lang.NullPointerException at 
org.apache.coyote.http11.Http11Processor.isCompressable(Http11Processor.java:1379) 
 
        if (noCompressionUserAgents != null) { 
            MessageBytes userAgentValueMB = 
                request.getMimeHeaders().getValue("user-agent"); 
            String userAgentValue = userAgentValueMB.toString();
Comment 1 Yoav Shapira 2005-09-22 16:25:29 UTC
This has been fixed on the 5.5 tree for a little.  I don't know when the next
5.0 release will be out.
Comment 2 Yoav Shapira 2005-09-22 16:27:42 UTC
It's also fixed on the 5.0 branch, but the fix was committed after the 5.0.30
release.  Again, we don't know when 5.0.31 will come out.  If you really need
the fix, you can grab the code from CVS for the TOMCAT_5_0 branch and build
yourself, or just add the one line of code that is the fix into your own custom
Tomcat build...  (Or move to 5.5 of course).