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

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


The following commit(s) were added to refs/heads/10.1.x by this push:
     new c89580ddcf Handle leading whitespace
c89580ddcf is described below

commit c89580ddcfd753c8be182680c919bd5eb925b167
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Oct 1 16:19:50 2026 +0100

    Handle leading whitespace
---
 java/org/apache/catalina/filters/AddDefaultCharsetFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java 
b/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java
index 192d76a4a0..28326c0c5c 100644
--- a/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java
+++ b/java/org/apache/catalina/filters/AddDefaultCharsetFilter.java
@@ -116,7 +116,7 @@ public class AddDefaultCharsetFilter extends FilterBase {
         public void setContentType(String contentType) {
 
             if (contentType != null) {
-                String lowerCaseContentType = 
contentType.toLowerCase(Locale.ENGLISH);
+                String lowerCaseContentType = 
contentType.toLowerCase(Locale.ENGLISH).trim();
                 if (lowerCaseContentType.startsWith("text/")) {
                     if (!lowerCaseContentType.contains("charset=")) {
                         super.setContentType(contentType + ";charset=" + 
encoding);


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

Reply via email to