mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
parent
0d23a63a96
commit
22012e0e9d
@ -519,7 +519,7 @@ func (c *context) NoContent(code int) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *context) Redirect(code int, url string) error {
|
func (c *context) Redirect(code int, url string) error {
|
||||||
if code < http.StatusMultipleChoices || code > http.StatusTemporaryRedirect {
|
if code < 300 || code > 308 {
|
||||||
return ErrInvalidRedirectCode
|
return ErrInvalidRedirectCode
|
||||||
}
|
}
|
||||||
c.response.Header().Set(HeaderLocation, url)
|
c.response.Header().Set(HeaderLocation, url)
|
||||||
|
@ -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
|
## Configuration
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user