MCPcopy Create free account
hub / github.com/quay/clair / ServeHTTP

Method ServeHTTP

middleware/auth/handler.go:20–26  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

18}
19
20func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
21 if !h.auth.Check(r.Context(), r) {
22 w.WriteHeader(http.StatusUnauthorized)
23 return
24 }
25 h.next.ServeHTTP(w, r)
26}
27
28// Handler returns a http.Handler that gates access to the passed Handler behind
29// the passed Checker.

Callers

nothing calls this directly

Calls 2

WriteHeaderMethod · 0.80
CheckMethod · 0.65

Tested by

no test coverage detected