httprequest

package
v3.9.0-alpha.2+incompa... Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2018 License: Apache-2.0 Imports: 4 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 PrefersHTML

func PrefersHTML(req *http.Request) bool

PrefersHTML returns true if the request was made by something that looks like a browser, or can receive HTML

func SchemeHost added in v1.3.0

func SchemeHost(req *http.Request) (string, string)

SchemeHost returns the scheme and host used to make this request. Suitable for use to compute scheme/host in returned 302 redirect Location. Note the returned host is not normalized, and may or may not contain a port. Returned values are based on the following information:

Host: * X-Forwarded-Host/X-Forwarded-Port headers * Host field on the request (parsed from Host header) * Host in the request's URL (parsed from Request-Line)

Scheme: * X-Forwarded-Proto header * Existence of TLS information on the request implies https * Scheme in the request's URL (parsed from Request-Line) * Port (if included in calculated Host value, 443 implies https) * Otherwise, defaults to "http"

Types

This section is empty.

Jump to

Keyboard shortcuts

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