From f281f15fe5b1649f57f44e4ca266e4b65cda3f0b Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Fri, 9 Feb 2024 10:06:42 -0800 Subject: [PATCH] Add the host header to the set of forbidden headers --- crates/wasi-http/src/types.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/wasi-http/src/types.rs b/crates/wasi-http/src/types.rs index 428116dd8a11..3d8c4ef225cd 100644 --- a/crates/wasi-http/src/types.rs +++ b/crates/wasi-http/src/types.rs @@ -77,7 +77,7 @@ pub trait WasiHttpView: Send { /// Returns `true` when the header is forbidden according to this [`WasiHttpView`] implementation. pub(crate) fn is_forbidden_header(view: &mut dyn WasiHttpView, name: &HeaderName) -> bool { - static FORBIDDEN_HEADERS: [HeaderName; 9] = [ + static FORBIDDEN_HEADERS: [HeaderName; 10] = [ hyper::header::CONNECTION, HeaderName::from_static("keep-alive"), hyper::header::PROXY_AUTHENTICATE, @@ -86,6 +86,7 @@ pub(crate) fn is_forbidden_header(view: &mut dyn WasiHttpView, name: &HeaderName hyper::header::TE, hyper::header::TRANSFER_ENCODING, hyper::header::UPGRADE, + hyper::header::HOST, HeaderName::from_static("http2-settings"), ];