Documentation
¶
Overview ¶
Package httpclient contains helpers for HTTP clients that send credentials.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCrossOriginRedirect = errors.New("redirect to a different origin was blocked")
ErrCrossOriginRedirect is returned when a request with credentials is redirected to another origin.
Functions ¶
func Origin ¶
Origin returns scheme://host:port for a URL, with the default port filled in. It contains no user info, path or query, so it is safe to log.
func SameOrigin ¶
SameOrigin reports whether two URLs have the same scheme, host and effective port.
func SameOriginRedirects ¶
SameOriginRedirects is an http.Client CheckRedirect function for requests that carry credentials. It follows a redirect only when scheme, host and port stay the same as in the first request. net/http still forwards the Authorization header to subdomains, other ports and from https to http. This function blocks those redirects before a request reaches the new target.
Types ¶
This section is empty.