From 694cbc9ec01e77dbcd18a4c63a1206490dccd74e Mon Sep 17 00:00:00 2001 From: sergeyfrolov Date: Wed, 29 May 2019 12:25:55 -0600 Subject: [PATCH] Add realm to Proxy-Authenticate with probe resist (#58) In #53 we added a realm to the Proxy-Authenticate header, but the realm only is added, when `probe_resistance` is off. With this change, Proxy-Authenticate header will have a realm when `probe_resistance` is on as well. --- forwardproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forwardproxy.go b/forwardproxy.go index fbd76b3..4eda0b8 100644 --- a/forwardproxy.go +++ b/forwardproxy.go @@ -212,7 +212,7 @@ func serveHiddenPage(w http.ResponseWriter, authErr error) (int, error) { w.Header().Set("Content-Type", "text/html") if authErr != nil { - w.Header().Set("Proxy-Authenticate", "Basic") + w.Header().Set("Proxy-Authenticate", "Basic realm=\"Caddy Secure Web Proxy\"") w.WriteHeader(http.StatusProxyAuthRequired) w.Write([]byte(fmt.Sprintf(hiddenPage, AuthFail))) return 0, authErr