fix(server): send 400 responses on parse errors before closing connection

This commit is contained in:
Sean McArthur
2018-01-23 15:31:26 -08:00
parent 44c34ce9ad
commit 7cb72d2019
4 changed files with 109 additions and 2 deletions

View File

@@ -149,6 +149,7 @@ pub trait Http1Transaction {
fn parse(bytes: &mut BytesMut) -> ParseResult<Self::Incoming>;
fn decoder(head: &MessageHead<Self::Incoming>, method: &mut Option<::Method>) -> ::Result<Option<h1::Decoder>>;
fn encode(head: MessageHead<Self::Outgoing>, has_body: bool, method: &mut Option<Method>, dst: &mut Vec<u8>) -> ::Result<h1::Encoder>;
fn on_error(err: &::Error) -> Option<MessageHead<Self::Outgoing>>;
fn should_error_on_parse_eof() -> bool;
fn should_read_first() -> bool;