MCPcopy
hub / github.com/oauth2-proxy/oauth2-proxy / errorJSON

Method errorJSON

oauthproxy.go:1339–1345  ·  view source on GitHub ↗

errorJSON returns the error code with an application/json mime type

(rw http.ResponseWriter, code int)

Source from the content-addressed store, hash-verified

1337
1338// errorJSON returns the error code with an application/json mime type
1339func (p *OAuthProxy) errorJSON(rw http.ResponseWriter, code int) {
1340 rw.Header().Set("Content-Type", applicationJSON)
1341 rw.WriteHeader(code)
1342 // we need to send some JSON response because we set the Content-Type to
1343 // application/json
1344 rw.Write([]byte("{}"))
1345}
1346
1347// LoggingCSRFCookiesInOAuthCallback Log all CSRF cookies found in HTTP request OAuth callback,
1348// which were successfully parsed

Callers 1

ProxyMethod · 0.95

Calls 3

WriteHeaderMethod · 0.80
SetMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected