Skip to content

Commit

Permalink
Rescue urllib3.exceptions.LocationParseError...
Browse files Browse the repository at this point in the history
... to at least continue processing lists
  • Loading branch information
rvanlieshout committed Dec 14, 2021
1 parent e6c80b4 commit 46374ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nw_log4jcheck.py
Expand Up @@ -9,7 +9,7 @@
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
logging.basicConfig(level=logging.INFO)

# Change this to your DNS zone
# Change this to your DNS zone
HOSTNAME = "yourdns.zone.here"

header_injects = [
Expand Down Expand Up @@ -48,6 +48,8 @@ def send_request(url, headers={}, timeout=5):
logging.error(f"HTTP connection to target URL error: {e}")
except requests.exceptions.Timeout:
logging.error("HTTP request timeout")
except (requests.exceptions.InvalidURL, urllib3.exceptions.LocationParseError) as e:
logging.error(f"Failed to parse URL: {e}")

def check_urls(urls, wait, timeout):
url_identifiers=dict()
Expand Down

0 comments on commit 46374ca

Please sign in to comment.