You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/12/05 12:56:08 UTC

[Bug 54248] New: Retrieving content that contains a BOM via request.getReader() issue

https://issues.apache.org/bugzilla/show_bug.cgi?id=54248

            Bug ID: 54248
           Summary: Retrieving content that contains a BOM via
                    request.getReader() issue
           Product: Tomcat 6
           Version: 6.0.32
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: davids@bigkahuna.org
    Classification: Unclassified

If a request contains Content that includes the BOM - in my case Content-Type:
application/xml; charset-utf-16 - and the content has a BOM (FF FE), when
fetched utilizing the BufferedReader from getReader() - the first request
serviced on the AJP thread works correctly (encoded correctly, only characters
fetched), however, any subsequent request on the thread which includes the BOM
has the BOM being delivered to the application. It appears via review of the
Tomcat code, that the recycle() method in B2CConverter simply ensures the
socket's data has been completely flushed and the underlying InputStream
doesn't get reset (don't really know if there is a way to do this without
re-instantiating it) to ensure subsequent requests BOM is consumed. I proved
this as a test by adding a call to reset() within the recycle() method which
re-instantiates the underlying InputStreams and the problem resolved itself. 

I've temporarily resolved the issue in my application code by using
request.getInputStream() and using request.getCharacterEncoding() and encoding
the content inside my application.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 54248] Retrieving content that contains a BOM via request.getReader() issue

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54248

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Thanks for the report.

The fix is to ensure that the decoder is reset between requests when the
converter is recycled.

The fix has been applied to trunk and 7.0.x and will be included in 7.0.35
onwards.

The fix has been proposed for 6.0.x.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 54248] Retrieving content that contains a BOM via request.getReader() issue

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54248

Konstantin Kolinko <kn...@gmail.com> changed:

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

--- Comment #2 from Konstantin Kolinko <kn...@gmail.com> ---
Fixed in 6.0 with r1444292 and will be in 6.0.37 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org