summaryrefslogtreecommitdiff
path: root/cherrypy/lib/httputil.py
diff options
context:
space:
mode:
authorTobias Henkel <tobias.henkel@bmw.de>2018-09-04 09:11:01 +0200
committerTobias Henkel <tobias.henkel@bmw.de>2018-09-04 13:14:15 +0200
commit802d0205a895fe2a73e9499ea3e572332f113a2a (patch)
tree60adc6f50cd247a14869174234e002311ca06dde /cherrypy/lib/httputil.py
parentce51624d23208bbeffddf37de84a3238f64ede7f (diff)
downloadcherrypy-git-802d0205a895fe2a73e9499ea3e572332f113a2a.tar.gz
Don't convert bytes headers to str
Don't convert bytes header values using str() as str(b'foo') becomes "b'foo'". Instead just leave bytes as is like it was prior to v18.0.0.
Diffstat (limited to 'cherrypy/lib/httputil.py')
-rw-r--r--cherrypy/lib/httputil.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cherrypy/lib/httputil.py b/cherrypy/lib/httputil.py
index ddafee5b..4ba5be31 100644
--- a/cherrypy/lib/httputil.py
+++ b/cherrypy/lib/httputil.py
@@ -513,7 +513,7 @@ class HeaderMap(CaseInsensitiveDict):
transmitting on the wire for HTTP.
"""
for k, v in header_items:
- if not isinstance(v, str):
+ if not isinstance(v, str) and not isinstance(v, bytes):
v = str(v)
yield tuple(map(cls.encode_header_item, (k, v)))