mercurial/hgweb/hgweb_mod.py
changeset 12739 8dcd3203a261
parent 12696 ef969e58a394
child 13445 61a898576888
--- a/mercurial/hgweb/hgweb_mod.py	Sat Oct 16 22:40:46 2010 +0200
+++ b/mercurial/hgweb/hgweb_mod.py	Sat Oct 16 17:29:04 2010 -0500
@@ -9,7 +9,8 @@
 import os
 from mercurial import ui, hg, hook, error, encoding, templater
 from common import get_mtime, ErrorResponse, permhooks, caching
-from common import HTTP_OK, HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
+from common import HTTP_OK, HTTP_NOT_MODIFIED, HTTP_BAD_REQUEST
+from common import HTTP_NOT_FOUND, HTTP_SERVER_ERROR
 from request import wsgirequest
 import webcommands, protocol, webutil
 
@@ -202,6 +203,9 @@
             return tmpl('error', error=str(inst))
         except ErrorResponse, inst:
             req.respond(inst, ctype)
+            if inst.code == HTTP_NOT_MODIFIED:
+                # Not allowed to return a body on a 304
+                return ['']
             return tmpl('error', error=inst.message)
 
     def templater(self, req):