-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
enhancementMaking things betterMaking things better
Description
Exclude data:
URLs from the assert_no_404_errors()
scan.
That can lead to false-positives. Currently, javascript:
and mailto:
URLs are already excluded.
The status code for each link is currently obtained by calling:
def _get_link_status_code(link, allow_redirects=False, timeout=5):
""" Get the status code of a link.
If the timeout is exceeded, will return a 404.
For a list of available status codes, see:
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
"""
status_code = None
try:
response = requests.get(
link, allow_redirects=allow_redirects, timeout=timeout)
status_code = response.status_code
except Exception:
status_code = 404
return status_code
Metadata
Metadata
Assignees
Labels
enhancementMaking things betterMaking things better