Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* optimize dockerfile

* fix issue zeromicro#266
  • Loading branch information
kevwan authored Dec 11, 2020
1 parent ec2a9f2 commit 99596a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rest/router/patrouter.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (pr *patRouter) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
}

allow, ok := pr.methodNotAllowed(r.Method, reqPath)
allows, ok := pr.methodsAllowed(r.Method, reqPath)
if !ok {
pr.handleNotFound(w, r)
return
Expand All @@ -73,7 +73,7 @@ func (pr *patRouter) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if pr.notAllowed != nil {
pr.notAllowed.ServeHTTP(w, r)
} else {
w.Header().Set(allowHeader, allow)
w.Header().Set(allowHeader, allows)
w.WriteHeader(http.StatusMethodNotAllowed)
}
}
Expand All @@ -94,7 +94,7 @@ func (pr *patRouter) handleNotFound(w http.ResponseWriter, r *http.Request) {
}
}

func (pr *patRouter) methodNotAllowed(method, path string) (string, bool) {
func (pr *patRouter) methodsAllowed(method, path string) (string, bool) {
var allows []string

for treeMethod, tree := range pr.trees {
Expand Down

0 comments on commit 99596a4

Please sign in to comment.