This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 09e30aeb68 Store request header names using original case rather than
forcing to lc
09e30aeb68 is described below
commit 09e30aeb68edfd3ae79bfc5e8ba3211d884aeb4c
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 19d50a6ac2..ade70623f0 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -219,6 +219,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="Jasper">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]