Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrainAndClose ¶
DrainAndClose consumes the remaining response body and closes it to allow connection reuse.
func JoinBasePath ¶ added in v1.5.0
JoinBasePath ensures the provided suffix is properly joined to the base prefix. The suffix may be relative or absolute and is treated as relative when the base is non-empty.
func NormalizeBasePath ¶ added in v1.5.0
NormalizeBasePath converts a configured base URL into a path prefix that always begins with a leading slash and omits any trailing slash. An empty string indicates the root.
Types ¶
type HostAllowlist ¶ added in v1.30.0
type HostAllowlist struct {
// contains filtered or unexported fields
}
HostAllowlist matches the received HTTP Host against a fixed list.
func NewHostAllowlist ¶ added in v1.30.0
func NewHostAllowlist(entries []string) (*HostAllowlist, error)
NewHostAllowlist accepts exact hosts and leading *. subdomain wildcards. An empty list permits all hosts. Invalid entries return an error.
func (*HostAllowlist) Allows ¶ added in v1.30.0
func (list *HostAllowlist) Allows(host string) bool
Allows reports whether host, ignoring any port, matches a listed host name or IP.