mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
minor simplifications
This commit is contained in:
parent
050431fdd6
commit
a267934d99
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user