From 524eb92a9eeaca940d4bf73d7592e2e87df8652c Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Fri, 9 Oct 2026 08:18:16 +0200 Subject: [PATCH] feat(header): add CAPSULE_PROTOCOL standard header (RFC 9297) --- benches/src/header_map/basic.rs | 1 + src/header/mod.rs | 1 + src/header/name.rs | 6 ++++++ tests/header_map.rs | 1 + tests/header_map_fuzz.rs | 1 + 5 files changed, 10 insertions(+) diff --git a/benches/src/header_map/basic.rs b/benches/src/header_map/basic.rs index 8c198a026..40d4c720d 100644 --- a/benches/src/header_map/basic.rs +++ b/benches/src/header_map/basic.rs @@ -537,6 +537,7 @@ const STD: &'static [HeaderName] = &[ AUTHORIZATION, CACHE_CONTROL, CACHE_STATUS, + CAPSULE_PROTOCOL, CDN_CACHE_CONTROL, CONNECTION, CONTENT_DISPOSITION, diff --git a/src/header/mod.rs b/src/header/mod.rs index 1a5f1ede6..15d802ff1 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -70,6 +70,7 @@ pub use self::name::{ AUTHORIZATION, CACHE_CONTROL, CACHE_STATUS, + CAPSULE_PROTOCOL, CDN_CACHE_CONTROL, CONNECTION, CONTENT_DISPOSITION, diff --git a/src/header/name.rs b/src/header/name.rs index d3e38a214..eff5e2dfe 100644 --- a/src/header/name.rs +++ b/src/header/name.rs @@ -350,6 +350,12 @@ standard_headers! { /// See [RFC 9211](https://www.rfc-editor.org/rfc/rfc9211.html). (CacheStatus, CACHE_STATUS, b"cache-status"); + /// Indicates whether the Capsule Protocol is in use for a request or + /// response. + /// + /// See [RFC 9297](https://www.rfc-editor.org/rfc/rfc9297.html). + (CapsuleProtocol, CAPSULE_PROTOCOL, b"capsule-protocol"); + /// Specifies directives that allow origin servers to control the behavior of CDN caches /// interposed between them and clients separately from other caches that might handle the /// response. diff --git a/tests/header_map.rs b/tests/header_map.rs index 67505c2eb..da2e5accd 100644 --- a/tests/header_map.rs +++ b/tests/header_map.rs @@ -388,6 +388,7 @@ const STD: &'static [HeaderName] = &[ AUTHORIZATION, CACHE_CONTROL, CACHE_STATUS, + CAPSULE_PROTOCOL, CDN_CACHE_CONTROL, CONNECTION, CONTENT_DISPOSITION, diff --git a/tests/header_map_fuzz.rs b/tests/header_map_fuzz.rs index 14f172d0f..3c9712d9e 100644 --- a/tests/header_map_fuzz.rs +++ b/tests/header_map_fuzz.rs @@ -273,6 +273,7 @@ fn gen_header_name(g: &mut StdRng) -> HeaderName { header::AUTHORIZATION, header::CACHE_CONTROL, header::CACHE_STATUS, + header::CAPSULE_PROTOCOL, header::CDN_CACHE_CONTROL, header::CONNECTION, header::CONTENT_DISPOSITION,