Skip to content

Commit

Permalink
only scan webpages
Browse files Browse the repository at this point in the history
  • Loading branch information
s0md3v committed Apr 1, 2024
1 parent 538d560 commit 6d86371
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arjun/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ def stable_request(url, headers):
verify=False,
timeout=10,
allow_redirects=redirects_allowed)
if not response.headers.get('Content-Type', '').startswith('text/'):
print('%s URL doesn\'t seem to be a webpage. Skipping.' % info)
content = response.headers.get('Content-Type', '')
if not ('text' in content or 'html' in content or 'json' in content or 'xml' in content):
print('%s URL doesn\t seem to be a webpage. Skipping.' % info)
return None
return response.url
except Exception as e:
Expand Down

0 comments on commit 6d86371

Please sign in to comment.