diff --git a/aiohttp/web_reqrep.py b/aiohttp/web_reqrep.py index 90a7065c6c5..83cc6ec4004 100644 --- a/aiohttp/web_reqrep.py +++ b/aiohttp/web_reqrep.py @@ -846,15 +846,13 @@ def text(self, text): self.body = text.encode(self.charset) - def should_send_body(self): - return (self._req.method != hdrs.METH_HEAD and - self._status not in [204, 304]) - @asyncio.coroutine def write_eof(self): try: body = self._body - if body is not None and self.should_send_body(): + if (body is not None and + self._req.method != hdrs.METH_HEAD and + self._status not in [204, 304]): self.write(body) finally: self.set_tcp_nodelay(True)