MCPcopy
hub / github.com/vouch/vouch-proxy / cancelClearSetError

Function cancelClearSetError

pkg/responses/responses.go:122–127  ·  view source on GitHub ↗

cancelClearSetError convenience method to keep it DRY

(w http.ResponseWriter, r *http.Request, e error)

Source from the content-addressed store, hash-verified

120
121// cancelClearSetError convenience method to keep it DRY
122func cancelClearSetError(w http.ResponseWriter, r *http.Request, e error) {
123 log.Warn(e)
124 cookie.ClearCookie(w, r)
125 w.Header().Set(cfg.Cfg.Headers.Error, e.Error())
126 addErrandCancelRequest(r)
127}
128
129// cfg.ErrCtx is tested by `jwtmanager.JWTCacheHandler`
130func addErrandCancelRequest(r *http.Request) {

Callers 5

Error400Function · 0.85
Error401Function · 0.85
Error401HTTPFunction · 0.85
Error403Function · 0.85
Error500Function · 0.85

Calls 3

ClearCookieFunction · 0.92
addErrandCancelRequestFunction · 0.85
HeaderMethod · 0.80

Tested by

no test coverage detected