summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-11-15 22:40:44 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-11-15 22:40:44 (GMT)
commite3d0bf740f13fecee9e8df03782e245f4188bb30 (patch)
tree9148d7af6544945c46db71ab789ee3765340a7a3 /Lib/httplib.py
parent031f3fb69a9a21604ef16245fb95ca508c8a2d3b (diff)
downloadcpython-e3d0bf740f13fecee9e8df03782e245f4188bb30.zip
cpython-e3d0bf740f13fecee9e8df03782e245f4188bb30.tar.gz
cpython-e3d0bf740f13fecee9e8df03782e245f4188bb30.tar.bz2
The docs for httplib.HTTPConnection.putheader() have claimed for quite a while
that their could be an arbitrary number of values passed in. Turns out the code did not match that. The code now matches the docs.
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 2830ad7..bbda432 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -846,7 +846,7 @@ class HTTPConnection:
# For HTTP/1.0, the server will assume "not chunked"
pass
- def putheader(self, header, value):
+ def putheader(self, header, *values):
"""Send a request header line to the server.
For example: h.putheader('Accept', 'text/html')
@@ -854,7 +854,7 @@ class HTTPConnection:
if self.__state != _CS_REQ_STARTED:
raise CannotSendHeader()
- str = '%s: %s' % (header, value)
+ str = '%s: %s' % (header, '\r\n\t'.join(values))
self._output(str)
def endheaders(self):
@@ -989,6 +989,7 @@ class HTTP:
# set up delegation to flesh out interface
self.send = conn.send
self.putrequest = conn.putrequest
+ self.putheader = conn.putheader
self.endheaders = conn.endheaders
self.set_debuglevel = conn.set_debuglevel
@@ -1008,10 +1009,6 @@ class HTTP:
"Provide a getfile, since the superclass' does not use this concept."
return self.file
- def putheader(self, header, *values):
- "The superclass allows only one value argument."
- self._conn.putheader(header, '\r\n\t'.join(values))
-
def getreply(self):
"""Compat definition since superclass does not define it.