Version: v0.0.0-...-f8abdcd Latest Latest

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

Go to latest
Published: Jul 4, 2019 License: Apache-2.0 Imports: 4 Imported by: 0




This section is empty.


This section is empty.


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

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"


This section is empty.

Source Files

Jump to

Keyboard shortcuts

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