redirect

package
v6.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForceHTTPS

func ForceHTTPS(
	enable bool,
	hosts ...string,
) func(http.Handler) http.Handler

ForceHTTPS is a middleware which redirects http:// requests to https://

func Hosts

func Hosts(
	hosts map[string]string,
	enable bool,
) func(http.Handler) http.Handler

Hosts is a middleware which redirects from one host to another. (e.g. https://www.foo.bar -> https://foo.bar)

func TrailingSlash

func TrailingSlash(next http.Handler) http.Handler

TrailingSlash is a middleware which will redirect a matching request with a trailing slash in the path to the same endpoint without a trailing slash.

Types

This section is empty.

Jump to

Keyboard shortcuts

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