[CMF-checkins] CVS: Products/CMFDefault - utils.py:1.26.2.2

Tres Seaver tseaver at palladion.com
Thu Jul 7 16:05:02 EDT 2005


Update of /cvs-repository/Products/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv1550/CMFDefault

Modified Files:
      Tag: CMF-1_5-branch
	utils.py 
Log Message:
 - Collector #230: strip trailing blank line from multi-line value in RFC822-style headers.


=== Products/CMFDefault/utils.py 1.26.2.1 => 1.26.2.2 ===
--- Products/CMFDefault/utils.py:1.26.2.1	Sun Oct 17 15:35:50 2004
+++ Products/CMFDefault/utils.py	Thu Jul  7 16:04:32 2005
@@ -45,6 +45,11 @@
     for key, value in headers:
 
         vallines = linesplit.split( value )
+        while vallines:
+            if vallines[-1].rstrip() == '':
+                vallines = vallines[:-1]
+            else:
+                break
         munged.append( '%s: %s' % ( key, '\r\n  '.join( vallines ) ) )
 
     return '\r\n'.join( munged )
@@ -99,7 +104,7 @@
 
     for line in lines:
 
-        if not line.strip():
+        if not line:
             break
 
         tokens = line.split( ': ' )



More information about the CMF-checkins mailing list