Skip to content

Commit 0112d35

Browse files
committed
refactor(error): mark TransferEncodingInvalid variant only with server feature
1 parent f70c8ff commit 0112d35

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/error.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub(super) enum Header {
8484
Token,
8585
#[cfg(feature = "http1")]
8686
ContentLengthInvalid,
87-
#[cfg(feature = "http1")]
87+
#[cfg(all(feature = "http1", feature = "server"))]
8888
TransferEncodingInvalid,
8989
#[cfg(feature = "http1")]
9090
TransferEncodingUnexpected,
@@ -391,7 +391,7 @@ impl Error {
391391
Kind::Parse(Parse::Header(Header::ContentLengthInvalid)) => {
392392
"invalid content-length parsed"
393393
}
394-
#[cfg(feature = "http1")]
394+
#[cfg(all(feature = "http1", feature = "server"))]
395395
Kind::Parse(Parse::Header(Header::TransferEncodingInvalid)) => {
396396
"invalid transfer-encoding parsed"
397397
}
@@ -504,6 +504,7 @@ impl Parse {
504504
Parse::Header(Header::ContentLengthInvalid)
505505
}
506506

507+
#[cfg(all(feature = "http1", feature = "server"))]
507508
pub(crate) fn transfer_encoding_invalid() -> Self {
508509
Parse::Header(Header::TransferEncodingInvalid)
509510
}

0 commit comments

Comments
 (0)