We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b71f31e commit ed7e2eeCopy full SHA for ed7e2ee
simplehttpserver.go
@@ -63,8 +63,8 @@ func basicauthlayer(handler http.Handler) http.HandlerFunc {
63
user, pass, ok := r.BasicAuth()
64
if !ok || user != opts.Username || pass != opts.Password {
65
w.Header().Set("WWW-Authenticate", fmt.Sprintf("Basic realm=\"%s\"", opts.Realm))
66
- w.WriteHeader(401)
67
- w.Write([]byte("Unauthorized.\n"))
+ w.WriteHeader(http.StatusUnauthorized)
+ w.Write([]byte("Unauthorized.\n")) //nolint
68
return
69
}
70
handler.ServeHTTP(w, r)
0 commit comments