httpsecurity

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLocalRequest

func IsLocalRequest(r *http.Request) bool

IsLocalRequest identifies the only hosts allowed to use sensitive cookies over HTTP.

func LocalRedirectTarget

func LocalRedirectTarget(rawTarget string, fallback string) string

LocalRedirectTarget reduces every application redirect to a path on the current origin.

func RedirectExternal

func RedirectExternal(w http.ResponseWriter, r *http.Request, target *url.URL, statusCode int)

RedirectExternal requires callers to pass an explicit absolute HTTP URL.

func RedirectHTTPS

func RedirectHTTPS(w http.ResponseWriter, r *http.Request, statusCode int)

RedirectHTTPS upgrades a public request without accepting a host from any other source.

func RedirectLocal

func RedirectLocal(w http.ResponseWriter, r *http.Request, rawTarget string, statusCode int)

RedirectLocal is the only application boundary for redirects within the current site.

func SetSensitiveCookie

func SetSensitiveCookie(w http.ResponseWriter, r *http.Request, cookie *http.Cookie)

SetSensitiveCookie applies one policy to every authentication and challenge cookie.

func UsesHTTPS

func UsesHTTPS(r *http.Request) bool

UsesHTTPS reads transport state and the conventional proxy boundary header.

Types

This section is empty.

Jump to

Keyboard shortcuts

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