Skip to content

Commit

Permalink
fix(http1): skip debug assertion of content length for HEAD responses (
Browse files Browse the repository at this point in the history
…#3795)

Closes #3794
  • Loading branch information
23doors authored Nov 26, 2024
1 parent 7f4a682 commit eaf2267
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/proto/h1/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,14 @@ impl Server {
#[cfg(debug_assertions)]
{
if let Some(len) = headers::content_length_parse(&value) {
assert!(
if msg.req_method != &Some(Method::HEAD) || known_len != 0 {
assert!(
len == known_len,
"payload claims content-length of {}, custom content-length header claims {}",
known_len,
len,
);
}
}
}

Expand Down

1 comment on commit eaf2267

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'end_to_end'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: eaf2267 Previous: 7f4a682 Ratio
http2_parallel_x10_req_10kb_100_chunks_adaptive_window 24031624 ns/iter (± 17307194.82) 7788734 ns/iter (± 127770.08) 3.09

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.