hyperlane-plugin-negotiate 22.14.0

A response negotiation plugin for the Hyperlane framework, answering with the content coding the client accepts and with 304 Not Modified while a validator still matches.
Documentation
/// The body length below which a response is answered without a content coding.
pub(crate) const DEFAULT_MIN_LENGTH: usize = 256;

/// The prefix marking a weak HTTP entity-tag per RFC 9110.
pub(crate) const WEAK_ETAG_PREFIX: &str = "W/";

/// Lowercase hexadecimal digits used for stack-allocated strong ETag formatting.
pub(crate) const HEX_LOWER: &[u8; 16] = b"0123456789abcdef";

/// The parameter delimiter inside a `Content-Type` header value.
pub(crate) const MEDIA_TYPE_PARAM_DELIMITER: char = ';';

/// The `Cache-Control` directive forbidding response body transformation.
pub(crate) const CACHE_CONTROL_NO_TRANSFORM: &str = "no-transform";

/// The wildcard token in a `Vary` header field.
pub(crate) const VARY_WILDCARD: &str = "*";

/// Error reported when `CompressMiddleware::init` is called more than once.
pub(crate) const COMPRESS_CONFIG_ALREADY_SET: &str = "the compress configuration was already set";

/// Stack buffer capacity in bytes for joining multiple `Accept-Encoding` header values without heap allocation.
pub(crate) const STACK_ACCEPT_ENCODING_CAP: usize = 256;

/// Response inspection state indicating the response must not be compressed.
pub(crate) const COMPRESS_STATE_SKIP: u8 = 0;

/// Response inspection state indicating `Vary: Accept-Encoding` should be inserted.
pub(crate) const COMPRESS_STATE_SET_VARY: u8 = 1;

/// Response inspection state indicating `Accept-Encoding` should be appended to an existing `Vary` header.
pub(crate) const COMPRESS_STATE_ADD_VARY: u8 = 2;

/// Response inspection state indicating `Vary` already covers `Accept-Encoding` or `*`.
pub(crate) const COMPRESS_STATE_VARY_OK: u8 = 3;

/// Brotli content-coding token for fast-path negotiation.
pub(crate) const CODING_BR: &str = "br";

/// Gzip content-coding token for fast-path negotiation.
pub(crate) const CODING_GZIP: &str = "gzip";

/// Legacy x-gzip content-coding token for fast-path negotiation.
pub(crate) const CODING_X_GZIP: &str = "x-gzip";

/// Deflate content-coding token for fast-path negotiation.
pub(crate) const CODING_DEFLATE: &str = "deflate";