summaryrefslogtreecommitdiffstats
path: root/Tools/webchecker
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2002-06-06 17:01:21 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2002-06-06 17:01:21 (GMT)
commit88a20baa77493d2a432f1636d2933001f083f0e8 (patch)
treed7ab5ffe56634d42d7deb85c14af210edab71b84 /Tools/webchecker
parent478d47a168bf45da9014ac1a299a222726eda058 (diff)
downloadcpython-88a20baa77493d2a432f1636d2933001f083f0e8.zip
cpython-88a20baa77493d2a432f1636d2933001f083f0e8.tar.gz
cpython-88a20baa77493d2a432f1636d2933001f083f0e8.tar.bz2
Apply diff.txt from SF patch http://www.python.org/sf/561478
This uses cgi.parse_header() in Checker.checkforhtml(), so that webchecker recognises the mime type text/html even if options are specified.
Diffstat (limited to 'Tools/webchecker')
-rwxr-xr-xTools/webchecker/webchecker.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Tools/webchecker/webchecker.py b/Tools/webchecker/webchecker.py
index 470b15a..fa70f65 100755
--- a/Tools/webchecker/webchecker.py
+++ b/Tools/webchecker/webchecker.py
@@ -117,6 +117,7 @@ import pickle
import urllib
import urlparse
import sgmllib
+import cgi
import mimetypes
import robotparser
@@ -543,7 +544,7 @@ class Checker:
def checkforhtml(self, info, url):
if info.has_key('content-type'):
- ctype = string.lower(info['content-type'])
+ ctype = string.lower(cgi.parse_header(info['content-type'])[0])
else:
if url[-1:] == "/":
return 1