diff --git a/mitmproxy/protocol/http.py b/mitmproxy/protocol/http.py index bdda80cd2..13556e9c9 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: - self.data.headers["Proxy-Authorization"] = self.config.upstream_auth + flow.request.headers["Proxy-Authorization"] = self.config.upstream_auth self.process_request_hook(flow) if not flow.response: