Fix error during exit blockage detection when Set-Cookie missing

Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
James Taylor 2022-02-15 12:51:48 -08:00 committed by Jesús
parent 5260716d14
commit 3f4db4199c
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -344,7 +344,7 @@ def fetch_url(url, headers=(), timeout=15, report_text=None, data=None,
ip = ip.group(1).decode('ascii') if ip else None
if not ip:
ip = re.search(r'IP=((?:\d+\.)+\d+)',
response.getheader('Set-Cookie'))
response.getheader('Set-Cookie') or '')
ip = ip.group(1) if ip else None
# don't get new identity if we're not using Tor