Documentation
¶
Index ¶
- Constants
- func Add(h http.Header, key, value string)
- func AddIfNotExists(h http.Header, key, value string)
- func Del(h http.Header, key string)
- func Exists(h http.Header, key string) bool
- func Get(h http.Header, key string) string
- func Set(h http.Header, key, value string)
- func SetShared(h http.Header, key string, vs []string)
Constants ¶
View Source
const ( AcceptEncoding = "Accept-Encoding" AccessControlAllowCredentials = "Access-Control-Allow-Credentials" AccessControlAllowHeaders = "Access-Control-Allow-Headers" AccessControlAllowMethods = "Access-Control-Allow-Methods" AccessControlAllowOrigin = "Access-Control-Allow-Origin" AccessControlExposeHeaders = "Access-Control-Expose-Headers" AccessControlMaxAge = "Access-Control-Max-Age" AccessControlRequestHeaders = "Access-Control-Request-Headers" AccessControlRequestMethod = "Access-Control-Request-Method" Authorization = "Authorization" ContentEncoding = "Content-Encoding" ContentLength = "Content-Length" ContentType = "Content-Type" Origin = "Origin" RetryAfter = "Retry-After" SecWebsocketKey = "Sec-Websocket-Key" StrictTransportSecurity = "Strict-Transport-Security" Upgrade = "Upgrade" Vary = "Vary" WWWAuthenticate = "Www-Authenticate" XForwardedFor = "X-Forwarded-For" XForwardedHost = "X-Forwarded-Host" XForwardedMethod = "X-Forwarded-Method" XForwardedProto = "X-Forwarded-Proto" XForwardedURI = "X-Forwarded-Uri" XRealIP = "X-Real-Ip" XRequestID = "X-Request-Id" )
Headers in canonical format
Variables ¶
This section is empty.
Functions ¶
func AddIfNotExists ¶
func SetShared ¶ added in v0.15.0
SetShared assigns a pre-built value slice directly into the header map, sharing its backing array across every call instead of allocating a fresh []string{value} per request the way Set does.
Use it only for values fixed at construction time, and only on response headers: the shared slice must be treated as immutable. parapet's own middleware never mutate response header value slices in place — MapResponse rebuilds the slice, and only MapRequest mutates in place (request headers only) — so sharing is safe response-side. The cors middleware shares its precomputed header slices the same way.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.