tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1599739 - /tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
Date Tue, 03 Jun 2014 18:37:34 GMT
Author: markt
Date: Tue Jun  3 18:37:33 2014
New Revision: 1599739

URL: http://svn.apache.org/r1599739
Log:
Tiny bit of de-duplication.
Add reference to RFC2616 for case insensitivity of transfer encoding
names.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1599739&r1=1599738&r2=1599739&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Tue Jun  3 18:37:33
2014
@@ -677,8 +677,12 @@ public abstract class AbstractHttp11Proc
      * Add an input filter to the current request. If the encoding is not
      * supported, a 501 response will be returned to the client.
      */
-    private void addInputFilter(InputFilter[] inputFilters,
-                                     String encodingName) {
+    private void addInputFilter(InputFilter[] inputFilters, String encodingName) {
+
+        // Trim provided encoding name and convert to lower case since transfer
+        // encoding names are case insensitive. (RFC2616, section 3.6)
+        encodingName = encodingName.trim().toLowerCase(Locale.ENGLISH);
+
         if (encodingName.equals("identity")) {
             // Skip
         } else if (encodingName.equals("chunked")) {
@@ -1320,14 +1324,12 @@ public abstract class AbstractHttp11Proc
             int commaPos = transferEncodingValue.indexOf(',');
             String encodingName = null;
             while (commaPos != -1) {
-                encodingName = transferEncodingValue.substring(
-                        startPos, commaPos).toLowerCase(Locale.ENGLISH).trim();
+                encodingName = transferEncodingValue.substring(startPos, commaPos);
                 addInputFilter(inputFilters, encodingName);
                 startPos = commaPos + 1;
                 commaPos = transferEncodingValue.indexOf(',', startPos);
             }
-            encodingName = transferEncodingValue.substring(
-                    startPos).toLowerCase(Locale.ENGLISH).trim();
+            encodingName = transferEncodingValue.substring(startPos);
             addInputFilter(inputFilters, encodingName);
         }
 



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


Mime
View raw message