File tree 1 file changed +2
-0
lines changed
1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ func (rp *HttpReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)
132
132
return
133
133
}
134
134
if host .Client .Cnf .U != "" && host .Client .Cnf .P != "" && ! common .CheckAuth (req , host .Client .Cnf .U , host .Client .Cnf .P ) {
135
+ rw .Header ().Set ("WWW-Authenticate" , "Basic realm=\" Private Area\" " )
135
136
rw .WriteHeader (http .StatusUnauthorized )
136
137
rw .Write ([]byte ("Unauthorized" ))
137
138
return
@@ -141,6 +142,7 @@ func (rp *HttpReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)
141
142
rw .Write ([]byte ("502 Bad Gateway" ))
142
143
return
143
144
}
145
+ req .URL .Host = req .Host
144
146
req = req .WithContext (context .WithValue (req .Context (), "host" , host ))
145
147
req = req .WithContext (context .WithValue (req .Context (), "target" , targetAddr ))
146
148
req = req .WithContext (context .WithValue (req .Context (), "req" , req ))
You can’t perform that action at this time.
0 commit comments