Skip to content

Commit f736d98

Browse files
committed
fix: content length assertion for HEAD
1 parent 7f4a682 commit f736d98

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/proto/h1/role.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,9 @@ impl Server {
701701
// same to help developers find bugs.
702702
#[cfg(debug_assertions)]
703703
{
704-
if let Some(len) = headers::content_length_parse(&value) {
704+
if let Some(len) = headers::content_length_parse(&value)
705+
&& (msg.req_method != &Some(Method::HEAD) || known_len != 0)
706+
{
705707
assert!(
706708
len == known_len,
707709
"payload claims content-length of {}, custom content-length header claims {}",

0 commit comments

Comments
 (0)