MCPcopy Index your code
hub / github.com/PasarGuard/node / trackSuccessfulRequest

Method trackSuccessfulRequest

controller/rest/middleware.go:64–75  ·  view source on GitHub ↗
(next http.Handler)

Source from the content-addressed store, hash-verified

62}
63
64func (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}

Callers

nothing calls this directly

Implementers 1

Controllercontroller/controller.go

Calls 1

NewRequestMethod · 0.80

Tested by

no test coverage detected