Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(http2): remove host header when using http2 #3516

Merged
merged 3 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions awc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Update `brotli` dependency to `7`.
- Prevent panics on connection pool drop when Tokio runtime is shutdown early.
- Minimum supported Rust version (MSRV) is now 1.75.
- Do not send `Host` header on HTTP/2 requests, as it is not required, and some web servers may reject it.

## 3.5.1

Expand Down
4 changes: 2 additions & 2 deletions awc/src/client/h2proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use h2::{
SendStream,
};
use http::{
header::{HeaderValue, CONNECTION, CONTENT_LENGTH, TRANSFER_ENCODING},
header::{HeaderValue, CONNECTION, CONTENT_LENGTH, HOST, TRANSFER_ENCODING},
request::Request,
Method, Version,
};
Expand Down Expand Up @@ -97,7 +97,7 @@ where
// TODO: consider skipping other headers according to:
// https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2.2
// omit HTTP/1.x only headers
CONNECTION | TRANSFER_ENCODING => continue,
CONNECTION | TRANSFER_ENCODING | HOST => continue,
CONTENT_LENGTH if skip_len => continue,
// DATE => has_date = true,
_ => {}
Expand Down
Loading