summaryrefslogtreecommitdiffstats
path: root/Lib/http/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/http/client.py')
-rw-r--r--Lib/http/client.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 4a078d3..a4ec8e5 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -812,7 +812,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')
@@ -822,8 +822,11 @@ class HTTPConnection:
if hasattr(header, 'encode'):
header = header.encode('ascii')
- if hasattr(value, 'encode'):
- value = value.encode('ascii')
+ values = list(values)
+ for i, one_value in enumerate(values):
+ if hasattr(one_value, 'encode'):
+ values[i] = one_value.encode('ascii')
+ value = b'\r\n\t'.join(values)
header = header + b': ' + value
self._output(header)