Skip to content

Commit

Permalink
Try to decode header as utf8 and ignore any non-compliant characters …
Browse files Browse the repository at this point in the history
…to prevent errors
  • Loading branch information
gehaxelt committed Oct 1, 2019
1 parent d1182f3 commit 3bce18f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Finder/gitfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def findgitrepo(output_file, domains):
try:
# Try to download http://target.tld/.git/HEAD
with urlopen(''.join(['http://', domain, '/.git/HEAD']), timeout=5) as response:
answer = response.read(200).decode()
answer = response.read(200).decode('utf-8', 'ignore')

except HTTPError:
return
Expand Down

0 comments on commit 3bce18f

Please sign in to comment.