1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/// The body length below which a response is answered without a content coding.
pub const DEFAULT_MIN_LENGTH: usize = 256;
/// The prefix marking a weak HTTP entity-tag per RFC 9110.
pub const WEAK_ETAG_PREFIX: &str = "W/";
/// Lowercase hexadecimal digits used for stack-allocated strong ETag formatting.
pub const HEX_LOWER: & = b"0123456789abcdef";
/// The parameter delimiter inside a `Content-Type` header value.
pub const MEDIA_TYPE_PARAM_DELIMITER: char = ';';
/// The `Cache-Control` directive forbidding response body transformation.
pub const CACHE_CONTROL_NO_TRANSFORM: &str = "no-transform";
/// The wildcard token in a `Vary` header field.
pub const VARY_WILDCARD: &str = "*";
/// Error reported when `CompressMiddleware::init` is called more than once.
pub 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 const STACK_ACCEPT_ENCODING_CAP: usize = 256;
/// Response inspection state indicating the response must not be compressed.
pub const COMPRESS_STATE_SKIP: u8 = 0;
/// Response inspection state indicating `Vary: Accept-Encoding` should be inserted.
pub const COMPRESS_STATE_SET_VARY: u8 = 1;
/// Response inspection state indicating `Accept-Encoding` should be appended to an existing `Vary` header.
pub const COMPRESS_STATE_ADD_VARY: u8 = 2;
/// Response inspection state indicating `Vary` already covers `Accept-Encoding` or `*`.
pub const COMPRESS_STATE_VARY_OK: u8 = 3;
/// Brotli content-coding token for fast-path negotiation.
pub const CODING_BR: &str = "br";
/// Gzip content-coding token for fast-path negotiation.
pub const CODING_GZIP: &str = "gzip";
/// Legacy x-gzip content-coding token for fast-path negotiation.
pub const CODING_X_GZIP: &str = "x-gzip";
/// Deflate content-coding token for fast-path negotiation.
pub const CODING_DEFLATE: &str = "deflate";