From a267934d99e2e5d561a71ee3bc3944ddb6f6ce53 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 2 Apr 2016 22:00:14 +0200 Subject: [PATCH] minor simplifications --- mitmproxy/models/http.py | 3 --- mitmproxy/protocol/http.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/mitmproxy/models/http.py b/mitmproxy/models/http.py index 8052b9dea..8214cd7ea 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 56c5f9ea4..e58d34303 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: