Skip to content

Commit 2e86d63

Browse files
committed
Method comparision
1 parent 3540ace commit 2e86d63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"log"
1111
"net/http"
1212
"regexp"
13+
"strings"
1314

1415
"github.com/go-rs/rest-api-framework/utils"
1516
)
@@ -169,7 +170,7 @@ func (api API) ServeHTTP(res http.ResponseWriter, req *http.Request) {
169170
break
170171
}
171172

172-
if (route.method == "" || route.method == req.Method) && route.regex.Match(urlPath) {
173+
if (route.method == "" || strings.EqualFold(route.method, req.Method)) && route.regex.Match(urlPath) {
173174
ctx.found = route.method != "" //?
174175
ctx.Params = utils.Exec(route.regex, route.params, urlPath)
175176
route.handle(&ctx)

0 commit comments

Comments
 (0)