request

package
v1.54.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SchemeHTTP name for the HTTP scheme
	SchemeHTTP = "http"
	// SchemeHTTPS name for the HTTPS scheme
	SchemeHTTPS = "https"
)

Variables

This section is empty.

Functions

func GetHostWithoutPort added in v1.13.0

func GetHostWithoutPort(r *http.Request) string

GetHostWithoutPort returns a host without the port. The host(:port) comes from a Host: header if it is provided, otherwise it is a server name.

func GetRemoteAddrWithoutPort added in v1.46.0

func GetRemoteAddrWithoutPort(r *http.Request) string

GetRemoteAddrWithoutPort strips the port from the r.RemoteAddr

func IsHTTPS

func IsHTTPS(r *http.Request) bool

IsHTTPS checks whether the request originated from HTTP or HTTPS. It checks the value from r.URL.Scheme

Types

This section is empty.

Jump to

Keyboard shortcuts

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