CharacterCodingException during encoding is swallowed
-----------------------------------------------------
Key: ASYNCWEB-19
URL: https://issues.apache.org/jira/browse/ASYNCWEB-19
Project: Asyncweb
Issue Type: Bug
Components: Client
Affects Versions: client-1.0.0
Reporter: Sangjin Lee
Assignee: Sangjin Lee
Fix For: client-1.0.0
When encoding HTTP requests, CharacterCodingException may be thrown if any of
the elements contain characters that are not safe to include as the URL or as
headers. Currently HttpRequestEncoder handles it by simply printing the stack
trace to System.err. The CharacterCodingException is swallowed.
This is actually pretty bad. The moment such an exception is thrown (e.g.
header values containing non-ascii characters), the exception is thrown but
swallowed. HttpRequestEncoder skips the rest of the operation, flips the
incomplete buffer, and tries to send this incomplete (and invalid) HTTP
request. Since this request is not properly terminated by CRLF, the server may
wait thinking client will send more data, until eventually the operation times
out.
The desired behavior is to propagate the exception so that a
ProtocolEncoderException results, and the request fails fast in such a
situation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.