Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultNotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotFound) if r.Header.Get("Content-type") == "application/json" { _, _ = w.Write([]byte(`{"error": "The requested route does not exist"}`)) return } _, _ = w.Write([]byte(`The request route does not exist`)) })
DefaultNotFoundHandler is a default handler for handling 404 errors.
Functions ¶
func ErrorEnhancerRFC6749 ¶
ErrorEnhancerRFC6749 returns an error of type fosite.ErrorEnhancerRFC6749
func PermanentRedirect ¶ added in v0.0.11
func PermanentRedirect(to string) func(rw http.ResponseWriter, r *http.Request, _ httprouter.Params)
PermanentRedirect permanently redirects (302) a path to another one.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.