| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Server.Encoding
Description
Content-coding negotiation for served metadata, read from every Accept-Encoding field
(RFC 9110, section 12.5.3). Écluse offers gzip and identity, and reads x-gzip as gzip, as RFC
9110 section 8.4.1.3 asks of a recipient. Gzip wins a tie of positive qualities, a malformed
quality refuses its coding, and a refusal beats a duplicate offer. A request that excludes both
codings takes 406. Identity-only metadata ignores the field.
Synopsis
The operator's setting
data MetadataCompression Source #
Whether served metadata may be gzipped for a client that accepts it.
Constructors
| GzipWhenAccepted | Gzip a listing when the request's |
| IdentityOnly | Serve every listing in identity coding and ignore |
Instances
| Show MetadataCompression Source # | |
Defined in Ecluse.Core.Server.Encoding Methods showsPrec :: Int -> MetadataCompression -> ShowS # show :: MetadataCompression -> String # showList :: [MetadataCompression] -> ShowS # | |
| Eq MetadataCompression Source # | |
Defined in Ecluse.Core.Server.Encoding Methods (==) :: MetadataCompression -> MetadataCompression -> Bool # (/=) :: MetadataCompression -> MetadataCompression -> Bool # | |
Negotiation
data ContentCoding Source #
A content coding Écluse can serve a listing in.
Constructors
| IdentityCoding | |
| GzipCoding |
Instances
| Show ContentCoding Source # | |
Defined in Ecluse.Core.Server.Encoding Methods showsPrec :: Int -> ContentCoding -> ShowS # show :: ContentCoding -> String # showList :: [ContentCoding] -> ShowS # | |
| Eq ContentCoding Source # | |
Defined in Ecluse.Core.Server.Encoding Methods (==) :: ContentCoding -> ContentCoding -> Bool # (/=) :: ContentCoding -> ContentCoding -> Bool # | |
data CodingChoice Source #
The coding a request selects, or the refusal when it excludes every coding Écluse serves.
Constructors
| ServeCoding ContentCoding | |
| NoAcceptableCoding |
Instances
| Show CodingChoice Source # | |
Defined in Ecluse.Core.Server.Encoding Methods showsPrec :: Int -> CodingChoice -> ShowS # show :: CodingChoice -> String # showList :: [CodingChoice] -> ShowS # | |
| Eq CodingChoice Source # | |
Defined in Ecluse.Core.Server.Encoding | |
chooseCoding :: MetadataCompression -> RequestHeaders -> CodingChoice Source #
Select a listing's coding. Identity stays acceptable unless excluded, and outranks gzip only by an explicit higher quality.
Response headers
gzipEncodingHeader :: Header Source #
The Content-Encoding header of a gzip listing.
varyAcceptEncoding :: ResponseHeaders -> ResponseHeaders Source #
Add Accept-Encoding to a response's Vary, keeping the field names already listed.