From: Fred Drake Date: Tue, 12 Nov 2002 22:21:01 +0000 (+0000) Subject: Handle the Content-Type header a little more appropriately: if it X-Git-Tag: v2.2.3c1~238 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b22a1a2debebea5e653b1cfa80dc5a17c25b9fb;p=thirdparty%2FPython%2Fcpython.git Handle the Content-Type header a little more appropriately: if it contains options, drop them to get the major/minor content type. Modified from the supplied patch to support more whitespace variation. Closes SF patch #613605. --- diff --git a/Tools/webchecker/webchecker.py b/Tools/webchecker/webchecker.py index 470b15a101a4..b4017a8d4e82 100755 --- a/Tools/webchecker/webchecker.py +++ b/Tools/webchecker/webchecker.py @@ -544,6 +544,9 @@ class Checker: def checkforhtml(self, info, url): if info.has_key('content-type'): ctype = string.lower(info['content-type']) + if ';' in ctype: + # handle content-type: text/html; charset=iso8859-1 : + ctype = ctype.split(';', 1)[0].strip() else: if url[-1:] == "/": return 1