Documentation ¶
Overview ¶
Package slash provides a trailing slash remover handler for the ozzo routing package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Remover ¶
func Remover(status int) routing.Handler
Remover returns a handler that removes the trailing slash (if any) from the requested URL. The handler will redirect the browser to the new URL without the trailing slash. The status parameter should be either http.StatusMovedPermanently (301) or http.StatusFound (302). If the original URL has no trailing slash, the handler will do nothing. For example,
import ( "net/http" "github.com/go-ozzo/ozzo-routing" "github.com/go-ozzo/ozzo-routing/slash" ) r := routing.New() r.Use(slash.Remover(http.StatusMovedPermanently))
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.