Add realm to Proxy-Authenticate header

Resolves #52

Squid's default realm is "Squid proxy-caching web server",
so I decided to give descriptive realm to Caddy as well.
This commit is contained in:
Sergey Frolov 2018-11-26 22:16:23 -07:00 committed by sergeyfrolov
parent 3dd9971580
commit ae59fae1dc

View file

@ -311,7 +311,7 @@ func (fp *ForwardProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) (int,
httpserver.WriteSiteNotFound(w, r)
return 0, authErr // current Caddy behavior without forwardproxy
} else {
w.Header().Set("Proxy-Authenticate", "Basic")
w.Header().Set("Proxy-Authenticate", "Basic realm=\"Caddy Secure Web Proxy\"")
return http.StatusProxyAuthRequired, authErr
}
}