mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 07:08:10 +00:00
Fixes AttributeError in transparent mode (#4951)
If we haven't connected to the upstream host in transparent mode, then the call to `write` on line 74 will raise an `AttributeError` as we haven't initialised `self.wfile`. If we add `AttributeError` to the `except` line, then we'll catch the exception and call `_connect`, which will in turn initialise `wfile`.
This commit is contained in:
parent
27e69651f6
commit
b1c1cd3f2f
@ -76,7 +76,7 @@ class Resolver:
|
||||
if addr is None:
|
||||
raise RuntimeError("Cannot resolve original destination.")
|
||||
return tuple(addr)
|
||||
except (EOFError, OSError):
|
||||
except (EOFError, OSError, AttributeError):
|
||||
self._connect()
|
||||
return self.original_addr(csock)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user