changeset 18349:c007e5c54b16

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.
author Mads Kiilerich <mads@kiilerich.com>
date Tue, 15 Jan 2013 01:05:12 +0100
parents 764a758780b6
children c0d63e1884a3
files mercurial/hgweb/server.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/server.py	Tue Jan 15 01:05:12 2013 +0100
+++ b/mercurial/hgweb/server.py	Tue Jan 15 01:05:12 2013 +0100
@@ -136,6 +136,8 @@
         self.length = None
         for chunk in self.server.application(env, self._start_response):
             self._write(chunk)
+        if not self.sent_headers:
+            self.send_headers()
 
     def send_headers(self):
         if not self.saved_status: