[Checkins] SVN: Zope/trunk/src/ZPublisher/HTTPResponse.py Yuck -- who gets the blame for that?

Tres Seaver tseaver at palladion.com
Fri May 28 17:55:20 EDT 2010


Log message for revision 112830:
  Yuck -- who gets the blame for that?

Changed:
  U   Zope/trunk/src/ZPublisher/HTTPResponse.py

-=-
Modified: Zope/trunk/src/ZPublisher/HTTPResponse.py
===================================================================
--- Zope/trunk/src/ZPublisher/HTTPResponse.py	2010-05-28 21:54:45 UTC (rev 112829)
+++ Zope/trunk/src/ZPublisher/HTTPResponse.py	2010-05-28 21:55:20 UTC (rev 112830)
@@ -896,13 +896,7 @@
         for key, val in headers.items():
             if key.lower() == key:
                 # only change non-literal header names
-                key = "%s%s" % (key[:1].upper(), key[1:])
-                start = 0
-                l = key.find('-',start)
-                while l >= start:
-                    key = "%s-%s%s" % (key[:l],key[l+1:l+2].upper(),key[l+2:])
-                    start = l + 1
-                    l = key.find('-', start)
+                key = '-'.join([x.capitalize() for x in key.split('-')])
             append("%s: %s" % (key, val))
         if self.cookies:
             headersl = headersl+self._cookie_list()



More information about the checkins mailing list