Skip to content

Commit 2090ee1

Browse files
committed
Merge pull request #6 from mbanzon/master
KeepContext respected
2 parents ae2e162 + 1d543c4 commit 2090ee1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pat.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
7171
}
7272
handler = r.NotFoundHandler
7373
}
74-
defer context.Clear(req)
74+
if !r.KeepContext {
75+
defer context.Clear(req)
76+
}
7577
handler.ServeHTTP(w, req)
7678
}
7779

0 commit comments

Comments
 (0)