Fix #298
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user