This commit is contained in:
Quentin McGaw
2020-11-13 01:14:05 +00:00
parent cbc5d466f6
commit 188d63c6b8

View File

@@ -10,6 +10,7 @@ func isAuthorized(responseWriter http.ResponseWriter, request *http.Request,
username, password string) (authorized bool) { username, password string) (authorized bool) {
basicAuth := request.Header.Get("Proxy-Authorization") basicAuth := request.Header.Get("Proxy-Authorization")
if len(basicAuth) == 0 { if len(basicAuth) == 0 {
responseWriter.Header().Set("Proxy-Authenticate", `Basic realm="Access to Gluetun over HTTP"`)
responseWriter.WriteHeader(http.StatusProxyAuthRequired) responseWriter.WriteHeader(http.StatusProxyAuthRequired)
return false return false
} }