From e984e74dcc7ee92a89cbd1bffa1640f30557bab8 Mon Sep 17 00:00:00 2001 From: Willem de Groot Date: Fri, 21 Aug 2015 14:51:40 +0200 Subject: [PATCH] Allow multi-line headers --- tornado/curl_httpclient.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- 2.47.2