Skip to content

Commit

Permalink
Fix possible race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Dec 22, 2016
1 parent ea92506 commit ddb19a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion macaron.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/go-macaron/inject"
)

const _VERSION = "1.1.10.1222"
const _VERSION = "1.1.11.1222"

func Version() string {
return _VERSION
Expand Down
4 changes: 3 additions & 1 deletion router.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ func (r *Router) NotFound(handlers ...Handler) {
validateHandlers(handlers)
r.notFound = func(rw http.ResponseWriter, req *http.Request) {
c := r.m.createContext(rw, req)
c.handlers = append(r.m.handlers, handlers...)
c.handlers = make([]Handler, 0, len(r.m.handlers)+len(handlers))
c.handlers = append(c.handlers, r.m.handlers...)
c.handlers = append(c.handlers, handlers...)
c.run()
}
}
Expand Down

0 comments on commit ddb19a9

Please sign in to comment.