https://bz.apache.org/bugzilla/show_bug.cgi?id=69164

            Bug ID: 69164
           Summary: Exception "java.lang.IllegalArgumentException", due
                    to: The Unicode character [木] outside the permitted
                    range of 0 to 255
           Product: Tomcat 9
           Version: 9.0.84
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: meghatalath...@gmail.com
  Target Milestone: -----

Overview: Tomcat removes the response header with unicode character [木] 
outside the permitted range of 0 to 255 in Tomcat versions (9.0.82 , 9.0.84
onwards)

Steps to Reproduce: 
Create a Java Servlet API and while returning response, add header as below
 "Last-Modified" : "木, 11 5月 2023 21:15:43 JST"


Actual Results: Tomcat remove the header before returning the response

03-Jul-2024 11:12:33.708 警告 [https-jsse-nio-443-exec-1]
org.apache.coyote.http11.Http11Processor.prepareResponse The HTTP response
header [Last-Modified] with value [木, 06 6月 2024 12:32:42 IST] has been removed
from the response because it is invalid
        java.lang.IllegalArgumentException: The Unicode character [木] at code
point [26,408] cannot be encoded as it is outside the permitted range of 0 to
255
                at
org.apache.tomcat.util.buf.MessageBytes.toBytesSimple(MessageBytes.java:286)
                at
org.apache.tomcat.util.buf.MessageBytes.toBytes(MessageBytes.java:255)
                at
org.apache.coyote.http11.Http11OutputBuffer.write(Http11OutputBuffer.java:394)
                at
org.apache.coyote.http11.Http11OutputBuffer.sendHeader(Http11OutputBuffer.java:372)
                at
org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1065)
                at
org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:379)
                at org.apache.coyote.Response.action(Response.java:211)
                at org.apache.coyote.Response.sendHeaders(Response.java:440)
                at
org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:292)
                at
org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:273)
                at
org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:118)


Expected Results: While returning a response, the header value should be
returned as below
"Last-Modified" : "木, 11 5月 2023 21:15:43 JST"


Additional Information: Working in Apache Tomcat 9.0.35, 9.0.56

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to