Skip to content

StripTrailingSlash results in a handler mismatching the root route. #218

Closed
@Retired

Description

@Retired

This is how I'm calling Echo.

e := echo.New()

e.StripTrailingSlash()

e.Any("/user", func(context *echo.Context) error {
    return context.String(http.StatusOK, "User handler!")
})

e.Run(":8000")

Going to http://localhost:8000/user brings up the expected string. However, the handler seems to be also triggering on http://localhost:8000.

Commenting out the e.StripTrailingSlash() line appears to fix this.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions