branch | stable |
changeset 37827 | 11ee9bf24791 |
parent 37746 | b29f490eb904 |
child 38039 | 5b831053d9b6 |
--- a/mercurial/hgweb/hgweb_mod.py Mon Apr 30 17:08:56 2018 -0700 +++ b/mercurial/hgweb/hgweb_mod.py Mon Apr 30 17:22:20 2018 -0700 @@ -399,6 +399,12 @@ tag = 'W/"%d"' % self.mtime if req.headers.get('If-None-Match') == tag: res.status = '304 Not Modified' + # Content-Type may be defined globally. It isn't valid on a + # 304, so discard it. + try: + del res.headers[b'Content-Type'] + except KeyError: + pass # Response body not allowed on 304. res.setbodybytes('') return res.sendresponse()