mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
serve: send response headers even if response has no body
The headers would usually be sent anyway because the app did a number of writes of empty strings.
This commit is contained in:
parent
ab33fcb117
commit
01096c5713
@ -136,6 +136,8 @@ class _httprequesthandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
|||||||
self.length = None
|
self.length = None
|
||||||
for chunk in self.server.application(env, self._start_response):
|
for chunk in self.server.application(env, self._start_response):
|
||||||
self._write(chunk)
|
self._write(chunk)
|
||||||
|
if not self.sent_headers:
|
||||||
|
self.send_headers()
|
||||||
|
|
||||||
def send_headers(self):
|
def send_headers(self):
|
||||||
if not self.saved_status:
|
if not self.saved_status:
|
||||||
|
Loading…
Reference in New Issue
Block a user