Header Names #
This module defines the Name type, which represents validated HTTP header names that conform to
HTTP standards.
Reference: https://www.rfc-editor.org/rfc/rfc9110.html#section-5
Proposition asserting that a string is a valid HTTP header name: all characters are valid token characters and the string is non-empty.
Reference: https://www.rfc-editor.org/rfc/rfc9110.html#name-field-names
Equations
Instances For
A validated HTTP header name that ensures all characters conform to HTTP standards. Header names are case-insensitive according to HTTP specifications.
Reference: https://www.rfc-editor.org/rfc/rfc9110.html#name-field-names
- value : String
The lowercased normalized header name string.
- isValidHeaderValue : IsValidHeaderName self.value
The proof that it's a valid header name.
- isLowerCase : Internal.IsLowerCase self.value
The proof that we stored the header name in stored as a lower case string.
Instances For
Equations
- Std.Http.Header.instReprName = { reprPrec := Std.Http.Header.instReprName.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Std.Http.Header.Name.instBEq = { beq := fun (a b : Std.Http.Header.Name) => decide (a.value = b.value) }
Equations
- Std.Http.Header.Name.instHashable = { hash := fun (x : Std.Http.Header.Name) => hash x.value }
Equations
- One or more equations did not get rendered due to their size.
Creates a Name from a string, panicking with an error message if the string contains invalid
characters for HTTP header names or is empty.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Converts the header name to title case (e.g., "Content-Type").
Note: some well-known headers have unconventional casing (e.g., "WWW-Authenticate"), but since HTTP header names are case-insensitive, this always uses simple capitalization.
Equations
- name.toCanonical = "-".intercalate (List.map (fun (x : String) => x.capitalize) (name.value.splitOn "-"))
Instances For
Equations
- Std.Http.Header.Name.instToString = { toString := fun (name : Std.Http.Header.Name) => name.toCanonical }
Standard Content-Type header name
Equations
- Std.Http.Header.Name.contentType = { value := "content-type", isValidHeaderValue := Std.Http.Header.Name.contentType._proof_1✝, isLowerCase := Std.Http.Header.Name.contentType._proof_2✝ }
Instances For
Standard Content-Length header name
Equations
- One or more equations did not get rendered due to their size.
Instances For
Standard Host header name
Equations
- Std.Http.Header.Name.host = { value := "host", isValidHeaderValue := Std.Http.Header.Name.host._proof_1✝, isLowerCase := Std.Http.Header.Name.host._proof_2✝ }
Instances For
Standard Authorization header name
Equations
- One or more equations did not get rendered due to their size.
Standard User-Agent header name
Equations
- Std.Http.Header.Name.userAgent = { value := "user-agent", isValidHeaderValue := Std.Http.Header.Name.userAgent._proof_1✝, isLowerCase := Std.Http.Header.Name.userAgent._proof_2✝ }
Instances For
Standard Accept header name
Equations
- Std.Http.Header.Name.accept = { value := "accept", isValidHeaderValue := Std.Http.Header.Name.accept._proof_1✝, isLowerCase := Std.Http.Header.Name.accept._proof_2✝ }
Instances For
Standard Connection header name
Equations
- Std.Http.Header.Name.connection = { value := "connection", isValidHeaderValue := Std.Http.Header.Name.connection._proof_1✝, isLowerCase := Std.Http.Header.Name.connection._proof_2✝ }
Instances For
Standard Transfer-Encoding header name
Equations
- One or more equations did not get rendered due to their size.
Instances For
Standard Server header name
Equations
- Std.Http.Header.Name.server = { value := "server", isValidHeaderValue := Std.Http.Header.Name.server._proof_1✝, isLowerCase := Std.Http.Header.Name.server._proof_2✝ }
Instances For
Standard Date header name
Equations
- Std.Http.Header.Name.date = { value := "date", isValidHeaderValue := Std.Http.Header.Name.date._proof_1✝, isLowerCase := Std.Http.Header.Name.date._proof_2✝ }
Instances For
Standard Expect header name
Equations
- Std.Http.Header.Name.expect = { value := "expect", isValidHeaderValue := Std.Http.Header.Name.expect._proof_1✝, isLowerCase := Std.Http.Header.Name.expect._proof_2✝ }