MCPcopy Index your code
hub / github.com/dreamsofcode-io/nethttp / writeUnauthed

Function writeUnauthed

middleware/auth.go:12–15  ·  view source on GitHub ↗
(w http.ResponseWriter)

Source from the content-addressed store, hash-verified

10const AuthUserID = "middleware.auth.userID"
11
12func writeUnauthed(w http.ResponseWriter) {
13 w.WriteHeader(http.StatusUnauthorized)
14 w.Write([]byte(http.StatusText(http.StatusUnauthorized)))
15}
16
17func IsAuthenticated(next http.Handler) http.Handler {
18 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers 1

IsAuthenticatedFunction · 0.85

Calls 1

WriteHeaderMethod · 0.80

Tested by

no test coverage detected