mercurial/hgweb/request.py
changeset 49846 fda5a4b853ab
parent 48946 642e31cb55f0
child 50820 9ed281bbf864
--- a/mercurial/hgweb/request.py	Wed Jan 04 16:02:22 2023 +0100
+++ b/mercurial/hgweb/request.py	Fri Dec 16 17:46:20 2022 +0100
@@ -485,6 +485,7 @@
             self._bodybytes is None
             and self._bodygen is None
             and not self._bodywillwrite
+            and self._req.method != b'HEAD'
         ):
             raise error.ProgrammingError(b'response body not defined')
 
@@ -594,6 +595,8 @@
                 yield chunk
         elif self._bodywillwrite:
             self._bodywritefn = write
+        elif self._req.method == b'HEAD':
+            pass
         else:
             error.ProgrammingError(b'do not know how to send body')