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

Mark Thomas <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #2 from Mark Thomas <[email protected]> ---
The provided test case passes.

The analysis has a couple of flaws.

1. UTF-32 does skip the BOM
   Process BOM reads up to 4 bytes from the InputStream
   For BOM less than 4 bytes long, the method has to handle skipping the
     correct number of bytes for the given BOM. This is what the skip method
     does.
   UTF-32 has a 4 byte BOM. Therefore if a UTF-32 BOM is detected, the BOM
     has already been fully read (i.e. skipped) and no correction for a
     shorter BOM is required.

2. The DefaultServlet never sets the Content-Length and removes the BOM
   The BOM is only removed if:
   - the content is included; or
   - conversion is required
   If conversion is required, the Content-Length is not explicitly set.
   The Content-Length may be explicitly set for an included resource but
     setContentLengthLong is a NO-OP for included resoucres.

If you can recreate this issue on a clean install of the latest release of a
currently supported Tomcat version (10.1.0-M16, 10.0.22, 9.0.64 or 8.5.81 at
the time of writing) then feel free to re-open this issue and provide the steps
to recreate.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to