Documentation
¶
Index ¶
- Constants
- func AppendCSP(w http.ResponseWriter, r *http.Request, cspDirectives []string, ...)
- func CopyHeader(dst, src http.Header)
- func FilterHeaders(h http.Header, allowed []string) http.Header
- func HeaderToMap(h http.Header) map[string]string
- func IsWebsocket(h http.Header) bool
- func RemoveHop(h http.Header)
- func RemoveHopByHopHeaders(h http.Header)
- func RemoveServiceHeaders(h http.Header)
- func UpgradeType(h http.Header) string
Constants ¶
View Source
const ( HeaderXForwardedMethod = "X-Forwarded-Method" HeaderXForwardedFor = "X-Forwarded-For" HeaderXForwardedProto = "X-Forwarded-Proto" HeaderXForwardedHost = "X-Forwarded-Host" HeaderXForwardedPort = "X-Forwarded-Port" HeaderXForwardedURI = "X-Forwarded-Uri" HeaderXRealIP = "X-Real-IP" HeaderContentType = "Content-Type" HeaderContentLength = "Content-Length" HeaderGoDoxyCheckRedirect = "X-Godoxy-Check-Redirect" )
Variables ¶
This section is empty.
Functions ¶
func AppendCSP ¶
AppendCSP appends a CSP header to specific directives in the response writer.
Directives other than the ones in cspDirectives will be kept as is.
It will replace 'none' with the sources.
It will append 'self' to the sources if it's not already present.
func CopyHeader ¶
func IsWebsocket ¶
func RemoveHopByHopHeaders ¶
RemoveHopByHopHeaders removes hop-by-hop headers.
func RemoveServiceHeaders ¶
func UpgradeType ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.