From cc5c22b6743bd5ae3d6ad6e90a95164a2b7cbb60 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sat, 10 May 2025 03:29:31 +0100 Subject: [PATCH] docs: update changelog --- actix-web/CHANGES.md | 2 +- actix-web/src/guard/host.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md index 3e1ae44c4..bc34fcd77 100644 --- a/actix-web/CHANGES.md +++ b/actix-web/CHANGES.md @@ -6,6 +6,7 @@ - Improve handling of non-UTF-8 header values in `Logger` middleware. - Add `HttpServer::shutdown_signal()` method. - Mark `HttpServer` as `#[must_use]`. +- Ignore `Host` header in `Host` guard when connection protocol is HTTP/2. - Re-export `mime` dependency. - Update `brotli` dependency to `8`. @@ -28,7 +29,6 @@ - On Windows, an error is now returned from `HttpServer::bind()` (or TLS variants) when binding to a socket that's already in use. - Update `brotli` dependency to `7`. - Minimum supported Rust version (MSRV) is now 1.75. -- Guard Host does not use Host header anymore when on HTTP/2, it only use authority pseudo header. ## 4.9.0 diff --git a/actix-web/src/guard/host.rs b/actix-web/src/guard/host.rs index e3c6640fe..835662346 100644 --- a/actix-web/src/guard/host.rs +++ b/actix-web/src/guard/host.rs @@ -1,4 +1,4 @@ -use actix_http::{header, uri::Uri, RequestHead}; +use actix_http::{header, uri::Uri, RequestHead, Version}; use super::{Guard, GuardContext}; @@ -66,7 +66,7 @@ fn get_host_uri(req: &RequestHead) -> Option { req.headers .get(header::HOST) .and_then(|host_value| host_value.to_str().ok()) - .filter(|_| req.version < actix_http::Version::HTTP_2) + .filter(|_| req.version < Version::HTTP_2) .or_else(|| req.uri.host()) .and_then(|host| host.parse().ok()) }