Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001874 [Resin] crash always 07-13-07 02:47 07-27-07 09:35
Reporter Leos View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.1.3 Product Version 3.0.23
  Product Build
Summary 0001874: ServletRequest.getInputStream() throws java.io.UnsupportedEncodingException
Description I am trying to get the http request body by calling getInputStream() on HttpServletRequest. I want the raw binary data, as http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletRequest.html#getInputStream() [^] promises. However, when the HTTP client sets the charset to some incorrect value (by sending the HTTP header Content-Type with ;charset=something), I get java.io.UnsupportedEncodingException. I believe that this is a violation of the above mentioned interface description from Sun. It says "Retrieves the body of the request as binary data" and does not allow throwing java.io.UnsupportedEncodingException. If I would like to handle the body as text (not as raw binary data) with the correct encoding, I would use getReader() instead.
Steps To Reproduce
Additional Information java.io.UnsupportedEncodingException: CP-1250
        at sun.io.Converters.getConverterClass(Converters.java:218)
        at sun.io.Converters.newConverter(Converters.java:251)
        at sun.io.ByteToCharConverter.getConverter(ByteToCharConverter.java:68)
        at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java:224)
        at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java:210)
        at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:77)
        at java.io.InputStreamReader.<init>(InputStreamReader.java:83)
        at com.caucho.vfs.i18n.JDKReader.create(JDKReader.java:68)
        at com.caucho.vfs.Encoding.getReadEncoding(Encoding.java:157)
        at com.caucho.vfs.ReadStream.setEncoding(ReadStream.java:456)
        at com.caucho.server.connection.AbstractHttpRequest.getStream(AbstractHttpRequest.java:1764)
        at com.caucho.server.connection.AbstractHttpRequest.getInputStream(AbstractHttpRequest.java:1823)
Attached Files

- Relationships

- Notes
(0002114)
Leos
07-13-07 06:22

It might be important to note that this happens inside filter.
 
(0002151)
ferg
07-27-07 09:35

server/1b23
 

- Issue History
Date Modified Username Field Change
07-13-07 02:47 Leos New Issue
07-13-07 06:22 Leos Note Added: 0002114
07-27-07 09:35 ferg Note Added: 0002151
07-27-07 09:35 ferg Assigned To  => ferg
07-27-07 09:35 ferg Status new => closed
07-27-07 09:35 ferg Resolution open => fixed
07-27-07 09:35 ferg Fixed in Version  => 3.1.3


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker