1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-16 21:26:34 +00:00

fix(http2): remove host header when using http2

This commit is contained in:
Joel Wurtz 2024-12-07 16:08:35 +01:00 committed by Joel Wurtz
parent 8115c818c1
commit 12107cdc5c
No known key found for this signature in database
GPG key ID: ED264D1967A51B0D
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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,
};
@ -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,
_ => {}