httputil

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2017 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 GetCookie

func GetCookie(r *http.Request, name string) (value string)

GetCookie retrieves and verifies the cookie value.

func GetHost

func GetHost(r *http.Request) string

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

func GetScheme(r *http.Request) string

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

func GetURL(r *http.Request) string

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

func IsHttps(r *http.Request) bool

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 SetCookie

func SetCookie(w http.ResponseWriter, r *http.Request, name, value string)

SetCookie writes the cookie value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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