Skip to content

Commit

Permalink
Merge pull request #3 from bluerail/rescue-parse-error
Browse files Browse the repository at this point in the history
Good addition, thanks!
  • Loading branch information
bart-roos committed Dec 14, 2021
2 parents e6c80b4 + 46374ca commit 1a1e95c
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 1a1e95c

Please sign in to comment.