withInsiders is middleware that sets insiders mode in the request context
(next http.Handler)
| 173 | |
| 174 | // withInsiders is middleware that sets insiders mode in the request context |
| 175 | func withInsiders(next http.Handler) http.Handler { |
| 176 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 177 | ctx := ghcontext.WithInsidersMode(r.Context(), true) |
| 178 | next.ServeHTTP(w, r.WithContext(ctx)) |
| 179 | }) |
| 180 | } |
| 181 | |
| 182 | func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 183 | inv, err := h.inventoryFactoryFunc(r) |