# HG changeset patch # User Mads Kiilerich # Date 2013-01-15 00:05:12 # Node ID c007e5c54b161b763563958ddb94bff8f6fe927e # Parent 764a758780b66dcff7986de1b4dd6e241b969076 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. diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py --- a/mercurial/hgweb/server.py +++ b/mercurial/hgweb/server.py @@ -136,6 +136,8 @@ class _httprequesthandler(BaseHTTPServer 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: