diff options
author | Salvatore Bonaccorso <carnil@debian.org> | 2018-07-07 00:28:56 +0200 |
---|---|---|
committer | Salvatore Bonaccorso <carnil@debian.org> | 2018-07-07 00:28:56 +0200 |
commit | 7523a3df6bc039ddb51e20ea9e9711c873663e83 (patch) | |
tree | 9b486636aa4e240349017e59284562aed1f2a398 /lib | |
parent | 6be1cdba2f755ec59935d418b80c87bebdf5fba9 (diff) | |
parent | ef94a323147ff01f512a8be2a8840d7a1d43a07a (diff) |
Merge branch 'jcristau/security-tracker-head'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/python/web_support.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/python/web_support.py b/lib/python/web_support.py index 0f58d450ac..c28452d5a0 100644 --- a/lib/python/web_support.py +++ b/lib/python/web_support.py @@ -664,7 +664,8 @@ class HTMLResult(Result): self.headers['Content-Length'] = str(len(buf)) def later(req): headers_later(req) - req.wfile.write(buf) + if req.command != 'HEAD': + req.wfile.write(buf) return later class BinaryResult(Result): @@ -686,7 +687,8 @@ class BinaryResult(Result): headers_later = super(BinaryResult, self).flatten_later() def later(req): headers_later(req) - req.wfile.write(self.contents) + if req.command != 'HEAD': + req.wfile.write(self.contents) return later class WebServiceBase: @@ -804,6 +806,7 @@ class WebServiceHTTP(WebServiceBase): finally: service_self.lock.release() result(self) + do_HEAD = do_GET def __parse_path(self): pos = self.path.find('?') |