diff --git a/CHANGELOG.md b/CHANGELOG.md index 71086025..4edeb470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# Unreleased + +* Add `HeaderName` constants for `cache-status` and `cdn-cache-control`. + # 0.2.8 (June 6, 2022) * Fix internal usage of uninitialized memory to use `MaybeUninit` inside `HeaderName`. diff --git a/benches/src/header_map/basic.rs b/benches/src/header_map/basic.rs index 078b89fb..8c198a02 100644 --- a/benches/src/header_map/basic.rs +++ b/benches/src/header_map/basic.rs @@ -536,6 +536,8 @@ const STD: &'static [HeaderName] = &[ ALT_SVC, AUTHORIZATION, CACHE_CONTROL, + CACHE_STATUS, + CDN_CACHE_CONTROL, CONNECTION, CONTENT_DISPOSITION, CONTENT_ENCODING, diff --git a/src/header/mod.rs b/src/header/mod.rs index 6c1b4955..1ca49450 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -101,6 +101,8 @@ pub use self::name::{ ALT_SVC, AUTHORIZATION, CACHE_CONTROL, + CACHE_STATUS, + CDN_CACHE_CONTROL, CONNECTION, CONTENT_DISPOSITION, CONTENT_ENCODING, diff --git a/src/header/name.rs b/src/header/name.rs index f0eaeb77..6080cf08 100644 --- a/src/header/name.rs +++ b/src/header/name.rs @@ -345,6 +345,18 @@ standard_headers! { /// response. (CacheControl, CACHE_CONTROL, b"cache-control"); + /// Indicates how caches have handled a response and its corresponding request. + /// + /// See [RFC 9211](https://www.rfc-editor.org/rfc/rfc9211.html). + (CacheStatus, CACHE_STATUS, b"cache-status"); + + /// 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. + /// + /// See [RFC 9213](https://www.rfc-editor.org/rfc/rfc9213.html). + (CdnCacheControl, CDN_CACHE_CONTROL, b"cdn-cache-control"); + /// Controls whether or not the network connection stays open after the /// current transaction finishes. /// diff --git a/tests/header_map.rs b/tests/header_map.rs index d02a5106..f2beba08 100644 --- a/tests/header_map.rs +++ b/tests/header_map.rs @@ -346,6 +346,8 @@ const STD: &'static [HeaderName] = &[ ALT_SVC, AUTHORIZATION, CACHE_CONTROL, + CACHE_STATUS, + CDN_CACHE_CONTROL, CONNECTION, CONTENT_DISPOSITION, CONTENT_ENCODING, diff --git a/tests/header_map_fuzz.rs b/tests/header_map_fuzz.rs index e008cbfd..68a8604f 100644 --- a/tests/header_map_fuzz.rs +++ b/tests/header_map_fuzz.rs @@ -282,6 +282,8 @@ fn gen_header_name(g: &mut StdRng) -> HeaderName { header::ALT_SVC, header::AUTHORIZATION, header::CACHE_CONTROL, + header::CACHE_STATUS, + header::CDN_CACHE_CONTROL, header::CONNECTION, header::CONTENT_DISPOSITION, header::CONTENT_ENCODING,