Robert Brewer  committed 89eeeda

Made request.headerMap a KeyTitlingDict.

  • Participants
  • Parent commits 8ad2db2

Comments (0)

Files changed (1)

File cherrypy/

     """A dict subclass which changes each key to str(key).title()
-    This allows response headers to be case-insensitive and
-    avoid duplicates.
+    This allows headers to be case-insensitive and avoid duplicates.
     def __getitem__(self, key):
         request.remotePort = clientAddress[1]
         request.remoteHost = remoteHost
         request.paramList = [] # Only used for Xml-Rpc
-        request.headerMap = {}
+        request.headerMap = KeyTitlingDict()
         request.simpleCookie = Cookie.SimpleCookie()
         request.rfile = rfile
         request.scheme = scheme
         # Process the headers into request.headerMap
         for name, value in self.requestHeaders:
-            name = name.title()
             value = value.strip()
             # Warning: if there is more than one header entry for cookies (AFAIK,
             # only Konqueror does that), only the last one will remain in headerMap
             # Handle cookies differently because on Konqueror, multiple
             # cookies come on different lines with the same key
-            if name == 'Cookie':
+            if name.title() == 'Cookie':
         # Write a message to the error.log only if there is no access.log.