Browse Source

Fix racy modification of NotFoundHandler.

Kamil Kisiel 12 years ago
parent
commit
854d482e26
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      mux.go

+ 3
- 3
mux.go View File

@ -87,10 +87,10 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
setCurrentRoute(req, match.Route)
}
if handler == nil {
if r.NotFoundHandler == nil {
r.NotFoundHandler = http.NotFoundHandler()
}
handler = r.NotFoundHandler
if handler == nil {
handler = http.NotFoundHandler()
}
}
if !r.KeepContext {
defer context.Clear(req)


Loading…
Cancel
Save