(next http.Handler)
| 62 | } |
| 63 | |
| 64 | func (s *Service) trackSuccessfulRequest(next http.Handler) http.Handler { |
| 65 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 66 | ww := middleware.NewWrapResponseWriter(w, r.ProtoMajor) |
| 67 | |
| 68 | next.ServeHTTP(ww, r) |
| 69 | |
| 70 | // Only track successful requests (status codes 200-299) |
| 71 | if status := ww.Status(); status >= 200 && status < 300 { |
| 72 | s.NewRequest() |
| 73 | } |
| 74 | }) |
| 75 | } |
nothing calls this directly
no test coverage detected