mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-11 02:39:46 +08:00
fix #1249: catch exceptions when requesting with disabling allow_redirects
This commit is contained in:
@@ -189,10 +189,11 @@ class HttpSession(requests.Session):
|
||||
|
||||
try:
|
||||
server_ip, server_port = response.raw._connection.sock.getpeername()
|
||||
except Exception:
|
||||
self.data.address.server_ip = server_ip
|
||||
self.data.address.server_port = server_port
|
||||
logger.debug(f"server IP: {server_ip}, Port: {server_port}")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# get length of the response content
|
||||
content_size = int(dict(response.headers).get("content-length") or 0)
|
||||
|
||||
Reference in New Issue
Block a user