From 22012e0e9da962b1b6a67b9e009d8eabe35d2d7e Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 26 Mar 2017 20:15:48 -0700 Subject: [PATCH] Fixed #833 Signed-off-by: Vishal Rana --- context.go | 2 +- website/content/middleware/trailing-slash.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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