diff --git a/context.go b/context.go index c1442010..798bcc24 100644 --- a/context.go +++ b/context.go @@ -519,7 +519,7 @@ func (c *context) NoContent(code int) error { } func (c *context) Redirect(code int, url string) error { - if code < http.StatusMultipleChoices || code > http.StatusTemporaryRedirect { + if code < 300 || code > 308 { return ErrInvalidRedirectCode } c.response.Header().Set(HeaderLocation, url) diff --git a/website/content/middleware/trailing-slash.md b/website/content/middleware/trailing-slash.md index c504f3c5..96912e7c 100644 --- a/website/content/middleware/trailing-slash.md +++ b/website/content/middleware/trailing-slash.md @@ -39,7 +39,7 @@ e.Use(middleware.AddTrailingSlashWithConfig(middleware.TrailingSlashConfig{ })) ``` -Example above will add a trailing slash to the request URI and redirect with `308 - StatusMovedPermanently`. +Example above will add a trailing slash to the request URI and redirect with `301 - StatusMovedPermanently`. ## Configuration