diff mercurial/hgweb/server.py @ 18380:a4d7fd7ad1f7

serve: don't send any content headers with 304 responses Fixes HTTP protocol violation introduced in cf5c76017e11. 'hg serve' would show a stacktrace when loading pages that not had been modified. There was test coverage for this, but the wrong response headers wasn't shown and thus not detected.
author Mads Kiilerich <madski@unity3d.com>
date Tue, 15 Jan 2013 20:54:57 +0100
parents cf5c76017e11
children 52ed85d9ac26
line wrap: on
line diff
--- a/mercurial/hgweb/server.py	Tue Jan 15 18:42:04 2013 +0100
+++ b/mercurial/hgweb/server.py	Tue Jan 15 20:54:57 2013 +0100
@@ -153,7 +153,8 @@
             self.send_header(*h)
             if h[0].lower() == 'content-length':
                 self.length = int(h[1])
-        if self.length is None:
+        if (self.length is None and
+            saved_status[0] != common.HTTP_NOT_MODIFIED):
             self._chunked = (not self.close_connection and
                              self.request_version == "HTTP/1.1")
             if self._chunked: