[Python-checkins] python/dist/src/Tools/webchecker webchecker.py,1.25.6.1,1.25.6.2

fdrake@users.sourceforge.net fdrake@users.sourceforge.net
Tue, 12 Nov 2002 14:21:03 -0800


Update of /cvsroot/python/python/dist/src/Tools/webchecker
In directory usw-pr-cvs1:/tmp/cvs-serv30979

Modified Files:
      Tag: release22-maint
	webchecker.py 
Log Message:
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.


Index: webchecker.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/webchecker/webchecker.py,v
retrieving revision 1.25.6.1
retrieving revision 1.25.6.2
diff -C2 -d -r1.25.6.1 -r1.25.6.2
*** webchecker.py	11 Mar 2002 10:04:07 -0000	1.25.6.1
--- webchecker.py	12 Nov 2002 22:21:01 -0000	1.25.6.2
***************
*** 545,548 ****
--- 545,551 ----
          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:] == "/":