[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/HTTP - HTTPResponse.py:1.3

Jim Fulton jim@zope.com
Thu, 13 Jun 2002 19:04:13 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/HTTP
In directory cvs.zope.org:/tmp/cvs-serv9613

Modified Files:
	HTTPResponse.py 
Log Message:
Changed hetHeader to convert the given key to lower case.

Changed setHeader to str it's arguments to avoid spurious unicode.


=== Zope3/lib/python/Zope/Publisher/HTTP/HTTPResponse.py 1.2 => 1.3 ===
     def setHeader(self, name, value, literal=0):
         'See Zope.Publisher.HTTP.IHTTPResponse.IHTTPResponse'
+
+        name = str(name)
+        value = str(value)
+
         key = name.lower()
         if accumulate_header(key):
             self.addHeader(name, value)
@@ -182,7 +186,7 @@
 
     def getHeader(self, name, default=None):
         'See Zope.Publisher.HTTP.IHTTPResponse.IHTTPResponse'
-        return self._headers.get(name, default)
+        return self._headers.get(name.lower(), default)
 
 
     def getHeaders(self):
@@ -270,7 +274,7 @@
     # from: Zope.Publisher.IPublisherResponse.IPublisherResponse
 
     def setBody(self, body):
-        self._body = body
+        self._body = str(body)
         if not self._status_set:
             self.setStatus(200)