Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit f0dcf13

Browse files
committed
http connect capture addon serverIpAddress fix
1 parent 2809253 commit f0dcf13

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

browserup-proxy-core/src/main/resources/mitmproxy/http_connect_capture.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,9 @@ def populate_timings_for_failed_connect(self):
147147
self.populate_dns_timings()
148148

149149
def populate_server_ip_address(self, flow, original_error):
150-
if isinstance(original_error, (ConnectionRefusedError, TcpTimeout)):
151-
if flow.server_conn and flow.server_conn.ip_address:
152-
self.get_har_entry()['serverIPAddress'] = str(
153-
flow.server_conn.ip_address[0])
154-
else:
155-
ctx.log.info("Cannot populate server IP address, unknown error: {}".format(original_error))
150+
if flow.server_conn is not None and flow.server_conn.ip_address is not None:
151+
self.get_har_entry()['serverIPAddress'] = str(
152+
flow.server_conn.ip_address[0])
156153

157154
def get_resource(self):
158155
return HttpConnectCaptureResource(self)

0 commit comments

Comments
 (0)