]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Cite RFC 2730 when stripping extraneous line breaks.
authorBen Darnell <ben@bendarnell.com>
Thu, 24 Jul 2014 02:24:04 +0000 (22:24 -0400)
committerBen Darnell <ben@bendarnell.com>
Thu, 24 Jul 2014 02:24:04 +0000 (22:24 -0400)
tornado/http1connection.py

index 0a6d87c103efb1b1209462e18e36a6c76c43693e..1e8196f8e61f57a568abe3038fc22cde1c4f9326 100644 (file)
@@ -471,6 +471,10 @@ class HTTP1Connection(httputil.HTTPConnection):
             self._finish_future.set_result(None)
 
     def _parse_headers(self, data):
+        # The lstrip removes newlines that some implementations sometimes
+        # insert between messages of a reused connection.  Per RFC 7230,
+        # we SHOULD ignore at least one empty line before the request.
+        # http://tools.ietf.org/html/rfc7230#section-3.5
         data = native_str(data.decode('latin1')).lstrip("\r\n")
         eol = data.find("\r\n")
         start_line = data[:eol]