From cf2a54794ff5067d6d815013d6570ee10f74d5e5 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 8 Mar 2015 23:08:25 -0400 Subject: [PATCH] simple_httpclient: finish() should be called even for body-less GET. This matters for HTTP2 where there is an explicit end-stream marker. --- tornado/simple_httpclient.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index beb55f239..6321a81df 100644 --- a/tornado/simple_httpclient.py +++ b/tornado/simple_httpclient.py @@ -375,7 +375,6 @@ class _HTTPConnection(httputil.HTTPMessageDelegate): def _write_body(self, start_read): if self.request.body is not None: self.connection.write(self.request.body) - self.connection.finish() elif self.request.body_producer is not None: fut = self.request.body_producer(self.connection.write) if is_future(fut): @@ -386,7 +385,7 @@ class _HTTPConnection(httputil.HTTPMessageDelegate): self._read_response() self.io_loop.add_future(fut, on_body_written) return - self.connection.finish() + self.connection.finish() if start_read: self._read_response() -- 2.47.2