ClearHandler wraps an http.Handler and clears request values at the end of a request lifetime.
(h http.Handler)
| 132 | // ClearHandler wraps an http.Handler and clears request values at the end |
| 133 | // of a request lifetime. |
| 134 | func ClearHandler(h http.Handler) http.Handler { |
| 135 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 136 | defer Clear(r) |
| 137 | h.ServeHTTP(w, r) |
| 138 | }) |
| 139 | } |