Documentation
¶
Index ¶
- func DelCookie(w http.ResponseWriter, r *http.Request, name string)
- func GetCookie(r *http.Request, name string) (value string)
- func GetHost(r *http.Request) string
- func GetScheme(r *http.Request) string
- func GetURL(r *http.Request) string
- func IsHTTPS(r *http.Request) bool
- func ParseHeader(r *http.Request, header string, token string) (val []string)
- func SetCookie(w http.ResponseWriter, r *http.Request, name, value string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DelCookie ¶
func DelCookie(w http.ResponseWriter, r *http.Request, name string)
DelCookie deletes a cookie.
func GetHost ¶
GetHost is a helper function that evaluates the http.Request and returns the hostname. It is able to detect, using the X-Forarded-For header, the original hostname when routed through a reverse proxy.
func GetScheme ¶
GetScheme is a helper function that evaluates the http.Request and returns the scheme, HTTP or HTTPS. It is able to detect, using the X-Forwarded-Proto, if the original request was HTTPS and routed through a reverse proxy with SSL termination.
func GetURL ¶
GetURL is a helper function that evaluates the http.Request and returns the URL as a string. Only the scheme + hostname are included; the path is excluded.
func IsHTTPS ¶
IsHTTPS is a helper function that evaluates the http.Request and returns True if the Request uses HTTPS. It is able to detect, using the X-Forwarded-Proto, if the original request was HTTPS and routed through a reverse proxy with SSL termination.
func ParseHeader ¶
ParseHeader parses non unique headers value from a http.Request and return a slice of the values queried from the header
Types ¶
This section is empty.