withToolset is middleware that extracts the toolset from the URL and sets it in the request context
(next http.Handler)
| 164 | |
| 165 | // withToolset is middleware that extracts the toolset from the URL and sets it in the request context |
| 166 | func withToolset(next http.Handler) http.Handler { |
| 167 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 168 | toolset := chi.URLParam(r, "toolset") |
| 169 | ctx := ghcontext.WithToolsets(r.Context(), []string{toolset}) |
| 170 | next.ServeHTTP(w, r.WithContext(ctx)) |
| 171 | }) |
| 172 | } |
| 173 | |
| 174 | // withInsiders is middleware that sets insiders mode in the request context |
| 175 | func withInsiders(next http.Handler) http.Handler { |
nothing calls this directly
no test coverage detected