Explorar o código

Basic authorization header for proxy needs to be 'Proxy-Authorization'

Eugene Fryntov %!s(int64=10) %!d(string=hai) anos
pai
achega
0693d6a93a
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      psiphon/upstreamproxy/auth_basic.go

+ 2 - 1
psiphon/upstreamproxy/auth_basic.go

@@ -24,7 +24,8 @@ func newBasicAuthenticator(challenge string) *BasicHttpAuthenticator {
 
 func (a BasicHttpAuthenticator) authenticate(req *http.Request, username, password string) error {
 	if a.state == BASIC_HTTP_AUTH_STATE_CHALLENGE_RECEIVED {
-		req.SetBasicAuth(username, password)
+		auth := username + ":" + password
+		req.Header.Set("Proxy-Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(auth)))
 		a.state = BASIC_HTTP_AUTH_STATE_RESPONSE_GENERATED
 		return nil
 	} else {