diff -r e0c0545e2e55 -r fda5a4b853ab mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Wed Jan 04 16:02:22 2023 +0100 +++ b/mercurial/hgweb/webcommands.py Fri Dec 16 17:46:20 2022 +0100 @@ -1299,6 +1299,9 @@ b'sendresponse() should not emit data if writing later' ) + if web.req.method == b'HEAD': + return [] + bodyfh = web.res.getbodyfile() archival.archive(