This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new aa2377051f Store request header names using original case rather than 
forcing to lc
aa2377051f is described below

commit aa2377051f42d7c182b11491b01493be5c689e5b
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Sep 19 15:09:25 2025 +0100

    Store request header names using original case rather than forcing to lc
---
 java/org/apache/tomcat/util/http/parser/HttpHeaderParser.java | 9 ---------
 webapps/docs/changelog.xml                                    | 4 ++++
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/java/org/apache/tomcat/util/http/parser/HttpHeaderParser.java 
b/java/org/apache/tomcat/util/http/parser/HttpHeaderParser.java
index 7ef3b8b5ee..41c3c6c96d 100644
--- a/java/org/apache/tomcat/util/http/parser/HttpHeaderParser.java
+++ b/java/org/apache/tomcat/util/http/parser/HttpHeaderParser.java
@@ -33,10 +33,6 @@ public class HttpHeaderParser {
     private static final byte SP = (byte) ' ';
     private static final byte HT = (byte) '\t';
     private static final byte COLON = (byte) ':';
-    private static final byte A = (byte) 'A';
-    private static final byte a = (byte) 'a';
-    private static final byte Z = (byte) 'Z';
-    private static final byte LC_OFFSET = A - a;
 
     private final HeaderDataSource source;
     private final MimeHeaders headers;
@@ -150,11 +146,6 @@ public class HttpHeaderParser {
                 // skipLine() will handle the error
                 return skipLine();
             }
-
-            // chr is next byte of header name. Convert to lowercase.
-            if (chr >= A && chr <= Z) {
-                source.getHeaderByteBuffer().put(pos, (byte) (chr - 
LC_OFFSET));
-            }
         }
 
         // Skip the line and ignore the header
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e3a31d899e..dae2a5ffa0 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -139,6 +139,10 @@
         Optimize the conversion of HTTP method from byte form to String form.
         (markt)
       </add>
+      <fix>
+        Store HTTP request headers using the original case for the header name
+        rather than forcing it to lower case. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Cluster">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to