diff options
author | Tobias Henkel <tobias.henkel@bmw.de> | 2018-09-04 09:11:01 +0200 |
---|---|---|
committer | Tobias Henkel <tobias.henkel@bmw.de> | 2018-09-04 13:14:15 +0200 |
commit | 802d0205a895fe2a73e9499ea3e572332f113a2a (patch) | |
tree | 60adc6f50cd247a14869174234e002311ca06dde /cherrypy/lib/httputil.py | |
parent | ce51624d23208bbeffddf37de84a3238f64ede7f (diff) | |
download | cherrypy-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.py | 2 |
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))) |