Skip to content

Commit

Permalink
Fix stackoverflow.com reject requests w/o user-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
patnr committed Sep 26, 2023
1 parent 2fffa3c commit 869ec03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def _report_error(msg):

def _link_is_down(link):
try:
request = urllib.request.Request(link, method="HEAD")
request = urllib.request.Request(
link, method="HEAD", headers={'User-Agent': 'Mozilla'})
response = urllib.request.urlopen(request, timeout=2)
assert response.status == 200
except Exception as e:
Expand Down

0 comments on commit 869ec03

Please sign in to comment.