]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
fix[curl_httpclient]: allow HTTP header to include non-ASCII ISO8859-1 values
authorFlorian Best <best@univention.de>
Sun, 17 Oct 2021 20:24:10 +0000 (22:24 +0200)
committerFlorian Best <best@univention.de>
Fri, 28 Jan 2022 19:45:54 +0000 (20:45 +0100)
tornado/curl_httpclient.py

index 386094495634227081917788efa92b24e4d6512d..61b6b7a9b54372803854a14fbadd859eb6854fba 100644 (file)
@@ -350,7 +350,8 @@ class CurlAsyncHTTPClient(AsyncHTTPClient):
         curl.setopt(
             pycurl.HTTPHEADER,
             [
-                "%s: %s" % (native_str(k), native_str(v))
+                b"%s: %s"
+                % (native_str(k).encode("ASCII"), native_str(v).encode("ISO8859-1"))
                 for k, v in request.headers.get_all()
             ],
         )