Commit 88a20baa authored by Walter Dörwald's avatar Walter Dörwald

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.
parent 478d47a1
...@@ -117,6 +117,7 @@ import pickle ...@@ -117,6 +117,7 @@ import pickle
import urllib import urllib
import urlparse import urlparse
import sgmllib import sgmllib
import cgi
import mimetypes import mimetypes
import robotparser import robotparser
...@@ -543,7 +544,7 @@ class Checker: ...@@ -543,7 +544,7 @@ class Checker:
def checkforhtml(self, info, url): def checkforhtml(self, info, url):
if info.has_key('content-type'): if info.has_key('content-type'):
ctype = string.lower(info['content-type']) ctype = string.lower(cgi.parse_header(info['content-type'])[0])
else: else:
if url[-1:] == "/": if url[-1:] == "/":
return 1 return 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment