Skip to content

Commit 5d20a0c

Browse files
committed
router: support wildcard method
1 parent 8d11552 commit 5d20a0c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

router/router.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (self *Router) ServeHTTP(w http.ResponseWriter, r *http.Request) {
5656
for _, route := range self.routes {
5757
matches := route.regex.FindStringSubmatch(r.URL.Path)
5858
if 0 < len(matches) {
59-
if r.Method != route.method {
59+
if r.Method != route.method && route.method != "*" {
6060
allow = append(allow, route.method)
6161
continue
6262
}

0 commit comments

Comments
 (0)