Skip to content

Commit

Permalink
refactor(error): mark TransferEncodingInvalid variant only with serve…
Browse files Browse the repository at this point in the history
…r feature
  • Loading branch information
seanmonstar committed Jul 21, 2021
1 parent f70c8ff commit 0112d35
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub(super) enum Header {
Token,
#[cfg(feature = "http1")]
ContentLengthInvalid,
#[cfg(feature = "http1")]
#[cfg(all(feature = "http1", feature = "server"))]
TransferEncodingInvalid,
#[cfg(feature = "http1")]
TransferEncodingUnexpected,
Expand Down Expand Up @@ -391,7 +391,7 @@ impl Error {
Kind::Parse(Parse::Header(Header::ContentLengthInvalid)) => {
"invalid content-length parsed"
}
#[cfg(feature = "http1")]
#[cfg(all(feature = "http1", feature = "server"))]
Kind::Parse(Parse::Header(Header::TransferEncodingInvalid)) => {
"invalid transfer-encoding parsed"
}
Expand Down Expand Up @@ -504,6 +504,7 @@ impl Parse {
Parse::Header(Header::ContentLengthInvalid)
}

#[cfg(all(feature = "http1", feature = "server"))]
pub(crate) fn transfer_encoding_invalid() -> Self {
Parse::Header(Header::TransferEncodingInvalid)
}
Expand Down

0 comments on commit 0112d35

Please sign in to comment.