Skip to content

Commit 12107cd

Browse files
committed
fix(http2): remove host header when using http2
1 parent 8115c81 commit 12107cd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

awc/CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Update `brotli` dependency to `7`.
66
- Prevent panics on connection pool drop when Tokio runtime is shutdown early.
77
- Minimum supported Rust version (MSRV) is now 1.75.
8+
- Do not send `Host` header on HTTP/2 requests, as it is not required, and some web servers may reject it.
89

910
## 3.5.1
1011

awc/src/client/h2proto.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use h2::{
1212
SendStream,
1313
};
1414
use http::{
15-
header::{HeaderValue, CONNECTION, CONTENT_LENGTH, TRANSFER_ENCODING},
15+
header::{HeaderValue, CONNECTION, CONTENT_LENGTH, HOST, TRANSFER_ENCODING},
1616
request::Request,
1717
Method, Version,
1818
};
@@ -97,7 +97,7 @@ where
9797
// TODO: consider skipping other headers according to:
9898
// https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2.2
9999
// omit HTTP/1.x only headers
100-
CONNECTION | TRANSFER_ENCODING => continue,
100+
CONNECTION | TRANSFER_ENCODING | HOST => continue,
101101
CONTENT_LENGTH if skip_len => continue,
102102
// DATE => has_date = true,
103103
_ => {}

0 commit comments

Comments
 (0)