MCPcopy Index your code
hub / github.com/git-bug/git-bug / Middleware

Function Middleware

api/auth/middleware.go:9–16  ·  view source on GitHub ↗
(fixedUserId entity.Id)

Source from the content-addressed store, hash-verified

7)
8
9func Middleware(fixedUserId entity.Id) func(http.Handler) http.Handler {
10 return func(next http.Handler) http.Handler {
11 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
12 ctx := CtxWithUser(r.Context(), fixedUserId)
13 next.ServeHTTP(w, r.WithContext(ctx))
14 })
15 }
16}

Callers 1

runWebUIFunction · 0.92

Calls 2

CtxWithUserFunction · 0.85
ServeHTTPMethod · 0.45

Tested by

no test coverage detected