bskyweb: middleware to remove trailing / (#598)
This commit is contained in:
parent
bf3ea67442
commit
9a91b0c538
1 changed files with 6 additions and 0 deletions
|
@ -92,6 +92,12 @@ func serve(cctx *cli.Context) error {
|
|||
e.Renderer = NewRenderer("templates/", &bskyweb.TemplateFS, debug)
|
||||
e.HTTPErrorHandler = customHTTPErrorHandler
|
||||
|
||||
// redirect trailing slash to non-trailing slash.
|
||||
// all of our current endpoints have no trailing slash.
|
||||
e.Use(middleware.RemoveTrailingSlashWithConfig(middleware.TrailingSlashConfig{
|
||||
RedirectCode: http.StatusFound,
|
||||
}))
|
||||
|
||||
// configure routes
|
||||
e.GET("/robots.txt", echo.WrapHandler(staticHandler))
|
||||
e.GET("/static/*", echo.WrapHandler(http.StripPrefix("/static/", staticHandler)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue