MCPcopy Index your code
hub / github.com/cortexproject/cortex / injectAuthHeader

Function injectAuthHeader

tools/auth-injector/main.go:54–59  ·  view source on GitHub ↗
(tenantID string, h http.Handler)

Source from the content-addressed store, hash-verified

52}
53
54func injectAuthHeader(tenantID string, h http.Handler) http.Handler {
55 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
56 r.Header.Set("X-Scope-OrgID", tenantID)
57 h.ServeHTTP(w, r)
58 })
59}

Callers 1

mainFunction · 0.85

Calls 2

SetMethod · 0.65
ServeHTTPMethod · 0.45

Tested by

no test coverage detected