From: Florian Best Date: Sun, 17 Oct 2021 20:24:10 +0000 (+0200) Subject: fix[curl_httpclient]: allow HTTP header to include non-ASCII ISO8859-1 values X-Git-Tag: v6.2.0b1~32^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4230bbc059b2df9b17c39406d22d1445682204e7;p=thirdparty%2Ftornado.git fix[curl_httpclient]: allow HTTP header to include non-ASCII ISO8859-1 values --- diff --git a/tornado/curl_httpclient.py b/tornado/curl_httpclient.py index 386094495..61b6b7a9b 100644 --- a/tornado/curl_httpclient.py +++ b/tornado/curl_httpclient.py @@ -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() ], )