diff --git a/demo.md b/demo.md index 8c7d889c7..7736c07d6 100644 --- a/demo.md +++ b/demo.md @@ -17,6 +17,7 @@ $1000 USD www.google.com http://broken.lifelinter.com http://news.ycombinator.com +http://tutsplus.com # Grammar the the meter is is great diff --git a/proselint/checks/misc/linkchecker.py b/proselint/checks/misc/linkchecker.py index 1fe0b437b..c1efbf2b3 100644 --- a/proselint/checks/misc/linkchecker.py +++ b/proselint/checks/misc/linkchecker.py @@ -50,7 +50,8 @@ def check(blob): def is_broken_link(url): """Check if the link return a 404 error.""" try: - urllib2.urlopen(url, timeout=2) + request = urllib2.Request(url, headers={'User-Agent': 'Mozilla/5.0'}) + urllib2.urlopen(request).read() return False except urllib2.URLError: return True