serveHTTPForOp serves only if op is allowed for this request and auth mode.
(w http.ResponseWriter, r *http.Request, op Operation)
| 422 | |
| 423 | // serveHTTPForOp serves only if op is allowed for this request and auth mode. |
| 424 | func (h Handler) serveHTTPForOp(w http.ResponseWriter, r *http.Request, op Operation) { |
| 425 | if Allowed(r, op) { |
| 426 | h.Handler.ServeHTTP(w, r) |
| 427 | } else { |
| 428 | SendUnauthorized(w, r) |
| 429 | } |
| 430 | } |
| 431 | |
| 432 | // RequireAuth wraps a function with another function that enforces |
| 433 | // HTTP Basic Auth and checks if the operations in op are all permitted. |
no test coverage detected