Skip to content

Commit

Permalink
fix(auth): Proxy-Authenticate instead of WWW-Authenticate
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksasiriski committed Oct 16, 2024
1 parent 3b2c84f commit 470c2ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func checkBasicAuth(w http.ResponseWriter, r *http.Request, creds credentials) b
auth := r.Header.Get("Proxy-Authorization")
if auth == "" {
slog.Debug("No Proxy-Authorization header found", "remote_addr", r.RemoteAddr, "host", r.Host, "proto", r.Proto, "method", r.Method, "url", r.URL.String())
w.Header().Set("WWW-Authenticate", `Basic realm="Restricted"`)
http.Error(w, "Unauthorized", http.StatusUnauthorized)
w.Header().Set("Proxy-Authenticate", "Basic realm=\"Proxy\"")
http.Error(w, "ProxyAuthRequired", http.StatusProxyAuthRequired)
return false
}

Expand Down

0 comments on commit 470c2ef

Please sign in to comment.