From: Willem de Groot Date: Fri, 21 Aug 2015 12:51:40 +0000 (+0200) Subject: Allow multi-line headers X-Git-Tag: v4.3.0b1~28^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e984e74dcc7ee92a89cbd1bffa1640f30557bab8;p=thirdparty%2Ftornado.git Allow multi-line headers --- diff --git a/tornado/curl_httpclient.py b/tornado/curl_httpclient.py index ae6f114a9..9c9481688 100644 --- a/tornado/curl_httpclient.py +++ b/tornado/curl_httpclient.py @@ -454,7 +454,8 @@ class CurlAsyncHTTPClient(AsyncHTTPClient): if header_callback is not None: self.io_loop.add_callback(header_callback, header_line) # header_line as returned by curl includes the end-of-line characters. - header_line = header_line.strip() + # whitespace at the start should be preserved to allow multi-line headers + header_line = header_line.rstrip() if header_line.startswith("HTTP/"): headers.clear() try: