no body and content length to 0 when 304 response is returned

This commit is contained in:
Arnulfo Solis
2018-02-02 13:24:51 +01:00
parent 0ab64e9803
commit 7ca3ad5d4c
2 changed files with 19 additions and 1 deletions

View File

@@ -198,7 +198,7 @@ class HTTPResponse(BaseHTTPResponse):
body = b''
content_length = 0
if self.status is not 204:
if self.status is not 204 and self.status != 304:
body = self.body
content_length = self.headers.get('Content-Length', len(self.body))