MCPcopy Create free account
hub / github.com/syncthing/syncthing / unauthorized

Function unauthorized

lib/api/api_auth.go:87–90  ·  view source on GitHub ↗
(w http.ResponseWriter, shortID string)

Source from the content-addressed store, hash-verified

85}
86
87func unauthorized(w http.ResponseWriter, shortID string) {
88 w.Header().Set("WWW-Authenticate", fmt.Sprintf(`Basic realm="Authorization Required (%s)"`, shortID))
89 http.Error(w, "Not Authorized", http.StatusUnauthorized)
90}
91
92func forbidden(w http.ResponseWriter) {
93 http.Error(w, "Forbidden", http.StatusForbidden)

Callers 1

ServeHTTPMethod · 0.85

Calls 3

ErrorMethod · 0.65
SetMethod · 0.45
HeaderMethod · 0.45

Tested by

no test coverage detected