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
- One or more equations did not get rendered due to their size.
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
- 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 = Std.Iter.intercalateString "-".toSlice (Std.Iter.map (fun (x : String.Slice) => x.copy.capitalize) (name.value.split '-'))
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✝ }
Instances For
Standard Cookie header name (client → server)
Equations
- Std.Http.Header.Name.cookie = { value := "cookie", isValidHeaderValue := Std.Http.Header.Name.cookie._proof_1✝, isLowerCase := Std.Http.Header.Name.cookie._proof_2✝ }
Standard Set-Cookie header name (server → client)
Equations
- Std.Http.Header.Name.setCookie = { value := "set-cookie", isValidHeaderValue := Std.Http.Header.Name.setCookie._proof_1✝, isLowerCase := Std.Http.Header.Name.setCookie._proof_2✝ }
Instances For
Standard Location header name
Equations
- Std.Http.Header.Name.location = { value := "location", isValidHeaderValue := Std.Http.Header.Name.location._proof_1✝, isLowerCase := Std.Http.Header.Name.location._proof_2✝ }
Instances For
Standard Proxy-Authorization header name
Equations
- One or more equations did not get rendered due to their size.
Instances For
Standard Content-Encoding header name
Equations
- One or more equations did not get rendered due to their size.
Instances For
Standard Content-Language header name
Equations
- One or more equations did not get rendered due to their size.
Instances For
Standard Content-Location header name
Equations
- One or more equations did not get rendered due to their size.
Instances For
Standard Last-Modified header name
Equations
- Std.Http.Header.Name.lastModified = { value := "last-modified", isValidHeaderValue := Std.Http.Header.Name.lastModified._proof_1✝, isLowerCase := Std.Http.Header.Name.lastModified._proof_2✝ }
Instances For
Standard Referer header name
Equations
- Std.Http.Header.Name.referer = { value := "referer", isValidHeaderValue := Std.Http.Header.Name.referer._proof_1✝, isLowerCase := Std.Http.Header.Name.referer._proof_2✝ }
Instances For
Standard Origin header name
Equations
- Std.Http.Header.Name.origin = { value := "origin", isValidHeaderValue := Std.Http.Header.Name.origin._proof_1✝, isLowerCase := Std.Http.Header.Name.origin._proof_2✝ }
Instances For
Standard Keep-Alive header name
Equations
- Std.Http.Header.Name.keepAlive = { value := "keep-alive", isValidHeaderValue := Std.Http.Header.Name.keepAlive._proof_1✝, isLowerCase := Std.Http.Header.Name.keepAlive._proof_2✝ }
Instances For
Standard If-None-Match header name
Equations
- Std.Http.Header.Name.ifNoneMatch = { value := "if-none-match", isValidHeaderValue := Std.Http.Header.Name.ifNoneMatch._proof_1✝, isLowerCase := Std.Http.Header.Name.ifNoneMatch._proof_2✝ }
Instances For
Standard If-Modified-Since header name
Equations
- One or more equations did not get rendered due to their size.