MCPcopy Index your code
hub / github.com/cubefs/cubefs / auditMiddleware

Method auditMiddleware

objectnode/api_middleware.go:64–73  ·  view source on GitHub ↗

AuditMiddleware returns a middleware handler that writes the local audit log before returning response.

(next http.Handler)

Source from the content-addressed store, hash-verified

62
63// AuditMiddleware returns a middleware handler that writes the local audit log before returning response.
64func (o *ObjectNode) auditMiddleware(next http.Handler) http.Handler {
65 return http.HandlerFunc(
66 func(w http.ResponseWriter, r *http.Request) {
67 if o.localAuditHandler != nil {
68 o.localAuditHandler.Handler(w, r, next.ServeHTTP)
69 } else {
70 next.ServeHTTP(w, r)
71 }
72 })
73}
74
75// TraceMiddleware returns a middleware handler to trace request.
76// After receiving the request, the handler will assign a unique RequestID to

Callers

nothing calls this directly

Calls 2

HandlerMethod · 0.65
ServeHTTPMethod · 0.45

Tested by

no test coverage detected