]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Allow multi-line headers
authorWillem de Groot <willem@byte.nl>
Fri, 21 Aug 2015 12:51:40 +0000 (14:51 +0200)
committerWillem de Groot <willem@byte.nl>
Fri, 21 Aug 2015 12:51:40 +0000 (14:51 +0200)
tornado/curl_httpclient.py

index ae6f114a95b92912c30297e48936c43119c673f2..9c9481688ae5c237af5e90a1231c7718ab67f1e4 100644 (file)
@@ -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: