···10101111 {2 Supported Headers}
12121313- - {!Content-Range} - Partial content range specification (RFC 9110 Section 14.4)
1414- - {!If-Range} - Conditional range request (RFC 9110 Section 13.1.5)
1515- - {!Allow} - Supported HTTP methods (RFC 9110 Section 10.2.1)
1616- - {!Authentication-Info} - Post-authentication info (RFC 9110 Section 11.6.3)
1717- - {!Retry-After} - Retry delay specification (RFC 9110 Section 10.2.3)
1818- - {!Accept-Ranges} - Range support indication (RFC 9110 Section 14.3)
1919- - {!Cache-Status} - Cache handling indication (RFC 9211)
2020- - {!Content-Digest} / {!Repr-Digest} - Body integrity verification (RFC 9530)
2121- - {!Strict-Transport-Security} - HSTS policy (RFC 6797)
1313+ - {{!section-content_range}Content-Range} - Partial content range specification (RFC 9110 Section 14.4)
1414+ - {{!section-if_range}If-Range} - Conditional range request (RFC 9110 Section 13.1.5)
1515+ - {{!section-allow}Allow} - Supported HTTP methods (RFC 9110 Section 10.2.1)
1616+ - {{!section-authentication_info}Authentication-Info} - Post-authentication info (RFC 9110 Section 11.6.3)
1717+ - {{!section-retry_after}Retry-After} - Retry delay specification (RFC 9110 Section 10.2.3)
1818+ - {{!section-accept_ranges}Accept-Ranges} - Range support indication (RFC 9110 Section 14.3)
1919+ - {{!section-cache_status}Cache-Status} - Cache handling indication (RFC 9211)
2020+ - {{!section-content_digest}Content-Digest / Repr-Digest} - Body integrity verification (RFC 9530)
2121+ - {{!section-hsts}Strict-Transport-Security} - HSTS policy (RFC 6797)
22222323 @see <https://www.rfc-editor.org/rfc/rfc9110> RFC 9110: HTTP Semantics
2424 @see <https://www.rfc-editor.org/rfc/rfc9211> RFC 9211: Cache-Status
2525 @see <https://www.rfc-editor.org/rfc/rfc9530> RFC 9530: Digest Fields
2626 @see <https://www.rfc-editor.org/rfc/rfc6797> RFC 6797: HTTP Strict Transport Security *)
27272828-(** {1 Content-Range (RFC 9110 Section 14.4)}
2828+(** {1:content_range Content-Range (RFC 9110 Section 14.4)}
29293030 The Content-Range header indicates which part of a representation is
3131 enclosed when a 206 (Partial Content) response is returned.
···5252 Returns [None] if the value cannot be parsed.
53535454 Examples:
5555- - ["bytes 0-499/1234"] -> Some {unit="bytes"; range=Some(0,499); complete_length=Some 1234}
5656- - ["bytes */1234"] -> Some {unit="bytes"; range=None; complete_length=Some 1234} *)
5555+ - ["bytes 0-499/1234"] -> [Some \{unit="bytes"; range=Some(0,499); complete_length=Some 1234\}]
5656+ - ["bytes */1234"] -> [Some \{unit="bytes"; range=None; complete_length=Some 1234\}] *)
57575858val make_content_range : start:int64 -> end_:int64 -> complete_length:int64 -> content_range
5959(** [make_content_range ~start ~end_ ~complete_length] creates a Content-Range
···6767(** [make_unsatisfied_range ~complete_length] creates a Content-Range value for
6868 an unsatisfied range (416 response). *)
69697070-(** {1 If-Range (RFC 9110 Section 13.1.5)}
7070+(** {1:if_range If-Range (RFC 9110 Section 13.1.5)}
71717272 The If-Range header makes a Range request conditional. It can contain
7373 either an ETag or a Last-Modified date.
···101101val if_range_is_date : if_range -> bool
102102(** [if_range_is_date ir] returns [true] if [ir] is a date. *)
103103104104-(** {1 Allow (RFC 9110 Section 10.2.1)}
104104+(** {1:allow Allow (RFC 9110 Section 10.2.1)}
105105106106 The Allow header lists the set of methods supported by the target resource.
107107···120120val allow_contains : Method.t -> string -> bool
121121(** [allow_contains method_ allow_value] checks if a method is in an Allow header value. *)
122122123123-(** {1 Authentication-Info (RFC 9110 Section 11.6.3)}
123123+(** {1:authentication_info Authentication-Info (RFC 9110 Section 11.6.3)}
124124125125 The Authentication-Info header is sent by the server after successful
126126 authentication. For Digest authentication, it provides:
···158158val get_nextnonce : authentication_info -> string option
159159(** [get_nextnonce info] returns the next nonce, if present. *)
160160161161-(** {1 Retry-After (RFC 9110 Section 10.2.3)}
161161+(** {1:retry_after Retry-After (RFC 9110 Section 10.2.3)}
162162163163 The Retry-After header indicates how long to wait before retrying.
164164···185185186186 @param now The current time as a Unix timestamp (for date calculation) *)
187187188188-(** {1 Accept-Ranges (RFC 9110 Section 14.3)}
188188+(** {1:accept_ranges Accept-Ranges (RFC 9110 Section 14.3)}
189189190190 The Accept-Ranges header indicates whether the server supports range requests.
191191···209209val supports_byte_ranges : accept_ranges -> bool
210210(** [supports_byte_ranges ar] returns [true] if byte range requests are supported. *)
211211212212-(** {1 Cache-Status (RFC 9211)}
212212+(** {1:cache_status Cache-Status (RFC 9211)}
213213214214 The Cache-Status header field indicates how caches have handled a request.
215215 It is a List structured field (RFC 8941) where each member is a cache
···291291(** [cache_status_get_fwd entries] returns the forward reason from the first
292292 cache that forwarded the request, if any. *)
293293294294-(** {1 Content-Digest / Repr-Digest (RFC 9530)}
294294+(** {1:content_digest Content-Digest / Repr-Digest (RFC 9530)}
295295296296 Content-Digest contains a digest of the content (after content coding).
297297 Repr-Digest contains a digest of the representation (before content coding).
···358358(** [get_strongest_digest digests] returns the strongest available digest.
359359 Prefers SHA-512 over SHA-256 over others. *)
360360361361-(** {1 Strict-Transport-Security (RFC 6797)}
361361+(** {1:hsts Strict-Transport-Security (RFC 6797)}
362362363363 The Strict-Transport-Security (HSTS) header tells browsers to only
364364 access the site over HTTPS, protecting against protocol downgrade
···384384 Returns [None] if the required max-age directive is missing.
385385386386 Example: ["max-age=31536000; includeSubDomains"] ->
387387- Some {max_age=31536000; include_subdomains=true; preload=false} *)
387387+ [Some \{max_age=31536000; include_subdomains=true; preload=false\}] *)
388388389389val hsts_to_string : hsts -> string
390390(** [hsts_to_string hsts] formats an HSTS value as a header string.
391391392392- Example: {max_age=31536000; include_subdomains=true; preload=false} ->
392392+ Example: [\{max_age=31536000; include_subdomains=true; preload=false\}] ->
393393 ["max-age=31536000; includeSubDomains"] *)
394394395395val make_hsts : ?max_age:int64 -> ?include_subdomains:bool -> ?preload:bool -> unit -> hsts
+1-1
lib/headers.mli
···284284285285(** {1 Connection Header Handling}
286286287287- Per {{:https://datatracker.ietf.org/doc/html/rfc9110#section-7.6.1}RFC 9110 Section 7.6.1}}:
287287+ Per {{:https://datatracker.ietf.org/doc/html/rfc9110#section-7.6.1}RFC 9110 Section 7.6.1}:
288288 The Connection header field lists hop-by-hop header fields that MUST be
289289 removed before forwarding the message. *)
290290