You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When AddTrainlingSlash middleware is used, the swagger route starts an infinite redirection loop resulting in ERR_TOO_MANY_REDIRECTS on the browser. It happens with both index.html and doc.json routes.
Steps to reproduce
Follow the usage instructions and add the AddTrailingSlash middleware to the app:
package main
import (
"github.com/labstack/echo/v4""github.com/labstack/echo/v4/middleware"
echoSwagger "github.com/swaggo/echo-swagger"
)
// @title Swagger Example API// @version 1.0// @description This is a sample server Petstore server.// @termsOfService http://swagger.io/terms/// @contact.name API Support// @contact.url http://www.swagger.io/support// @contact.email [email protected]// @license.name Apache 2.0// @license.url http://www.apache.org/licenses/LICENSE-2.0.html// @host petstore.swagger.io// @BasePath /v2funcmain() {
e:=echo.New()
e.Pre(middleware.AddTrailingSlash())
e.GET("/swagger/*", echoSwagger.WrapHandler)
e.Logger.Fatal(e.Start(":1323"))
}
The text was updated successfully, but these errors were encountered:
Current Behavior
When AddTrainlingSlash middleware is used, the swagger route starts an infinite redirection loop resulting in
ERR_TOO_MANY_REDIRECTS
on the browser. It happens with bothindex.html
anddoc.json
routes.Steps to reproduce
AddTrailingSlash
middleware to the app:The text was updated successfully, but these errors were encountered: