Skip to content

Commit 694cbc9

Browse files
authored
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.
1 parent 7af135a commit 694cbc9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

forwardproxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func serveHiddenPage(w http.ResponseWriter, authErr error) (int, error) {
212212

213213
w.Header().Set("Content-Type", "text/html")
214214
if authErr != nil {
215-
w.Header().Set("Proxy-Authenticate", "Basic")
215+
w.Header().Set("Proxy-Authenticate", "Basic realm=\"Caddy Secure Web Proxy\"")
216216
w.WriteHeader(http.StatusProxyAuthRequired)
217217
w.Write([]byte(fmt.Sprintf(hiddenPage, AuthFail)))
218218
return 0, authErr

0 commit comments

Comments
 (0)