RequestFromContext recovers the raw request stashed by withRawRequest.
(ctx context.Context)
| 393 | |
| 394 | // RequestFromContext recovers the raw request stashed by withRawRequest. |
| 395 | func RequestFromContext(ctx context.Context) *http.Request { |
| 396 | if r, ok := ctx.Value(reqCtxKey{}).(*http.Request); ok { |
| 397 | return r |
| 398 | } |
| 399 | return nil |
| 400 | } |
| 401 | |
| 402 | // requireUser authenticates the caller or returns a 401 envelope carrying |
| 403 | // the machine-branchable "unauthorized" code. |
no outgoing calls
no test coverage detected