-
Notifications
You must be signed in to change notification settings - Fork 923
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not produce an empty response when ServiceCodec raises an exception
Motivation: When a ServiceCodec.decodeRequest() raises an exception, HttpServerHandler will close the connection immediately without sending anything. Instead, the server should send a '400 Bad Request' response. Modifications: - HttpServerHandler now catches an exception raised by ServiceCodec.decodeRequest() and responds with a '400 Bad Request' response. - ThriftServiceCodec.decodeRequest() now catches an exception raised by TProtocol.readMessageBegin() and returns a failed DecoderResult instead of raising an exception. Result: - Armeria server sends a 400 Bad Request even if ServiceCodec.decodeRequest() raises an exception. - ThriftServiceCodec.decodeRequest() deals with a bad request better.
- Loading branch information
Showing
2 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters