1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-21 07:12:51 +00:00

Hotfix wildcard (#342)

* Hotfix wildcard
This commit is contained in:
Fenny 2020-05-07 19:43:25 +02:00 committed by GitHub
parent 8ea25a79b9
commit ae7d2bd754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,7 +129,7 @@ func (app *App) registerMethod(method, path string, handlers ...func(*Ctx)) {
path = "/"
}
// Path always start with a '/' or '*'
if path[0] != '/' && path[0] != '*' {
if path[0] != '/' {
path = "/" + path
}
// Store original path to strip case sensitive params
@ -148,7 +148,7 @@ func (app *App) registerMethod(method, path string, handlers ...func(*Ctx)) {
if isUse || method == "ALL" {
method = "*"
}
var isStar = path == "*" || path == "/*"
var isStar = path == "/*"
// Middleware containing only a `/` equals wildcard
if isUse && path == "/" {
isStar = true