From ae59fae1dcab075a77bd813454ad4e583ddd95df Mon Sep 17 00:00:00 2001 From: Sergey Frolov Date: Mon, 26 Nov 2018 22:16:23 -0700 Subject: [PATCH] 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. --- forwardproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forwardproxy.go b/forwardproxy.go index c421590..fbd76b3 100644 --- a/forwardproxy.go +++ b/forwardproxy.go @@ -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 } }