httpheaders

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 4 Imported by: 2

Documentation

Index

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

func AppendCSP(w http.ResponseWriter, r *http.Request, cspDirectives []string, sources []string)

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 CopyHeader(dst, src http.Header)

func FilterHeaders

func FilterHeaders(h http.Header, allowed []string) http.Header

func HeaderToMap

func HeaderToMap(h http.Header) map[string]string

func IsWebsocket

func IsWebsocket(h http.Header) bool

func RemoveHop

func RemoveHop(h http.Header)

func RemoveHopByHopHeaders

func RemoveHopByHopHeaders(h http.Header)

RemoveHopByHopHeaders removes hop-by-hop headers.

func RemoveServiceHeaders

func RemoveServiceHeaders(h http.Header)

func UpgradeType

func UpgradeType(h http.Header) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL