refactor(http1): return Parse::Internal error if there's an illegal header name or value (#2544)
This commit is contained in:
@@ -73,6 +73,8 @@ pub(super) enum Parse {
|
||||
Header,
|
||||
TooLarge,
|
||||
Status,
|
||||
#[cfg_attr(debug_assertions, allow(unused))]
|
||||
Internal,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
@@ -374,6 +376,9 @@ impl Error {
|
||||
Kind::Parse(Parse::Header) => "invalid HTTP header parsed",
|
||||
Kind::Parse(Parse::TooLarge) => "message head is too large",
|
||||
Kind::Parse(Parse::Status) => "invalid HTTP status-code parsed",
|
||||
Kind::Parse(Parse::Internal) => {
|
||||
"internal error inside Hyper and/or its dependencies, please report"
|
||||
}
|
||||
Kind::IncompleteMessage => "connection closed before message completed",
|
||||
#[cfg(feature = "http1")]
|
||||
Kind::UnexpectedMessage => "received unexpected message from connection",
|
||||
|
||||
Reference in New Issue
Block a user