aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mitmproxy/models/http.py3
-rw-r--r--mitmproxy/protocol/http.py2
2 files changed, 1 insertions, 4 deletions
diff --git a/mitmproxy/models/http.py b/mitmproxy/models/http.py
index 8052b9de..8214cd7e 100644
--- a/mitmproxy/models/http.py
+++ b/mitmproxy/models/http.py
@@ -184,9 +184,6 @@ class HTTPRequest(MessageMixin, Request):
def __hash__(self):
return id(self)
- def set_auth(self, auth):
- self.data.headers.set_all("Proxy-Authorization", (auth,))
-
def replace(self, pattern, repl, *args, **kwargs):
"""
Replaces a regular expression pattern with repl in the headers, the
diff --git a/mitmproxy/protocol/http.py b/mitmproxy/protocol/http.py
index 56c5f9ea..e58d3430 100644
--- a/mitmproxy/protocol/http.py
+++ b/mitmproxy/protocol/http.py
@@ -184,7 +184,7 @@ class HttpLayer(Layer):
flow.request = request
# set upstream auth
if self.mode == "upstream" and self.config.upstream_auth is not None:
- flow.request.set_auth(self.config.upstream_auth)
+ self.data.headers["Proxy-Authorization"] = self.config.upstream_auth
self.process_request_hook(flow)
if not flow.response: