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 | ab2f665b060a0cf34667f84b10207e0300d1222a (patch) | |
tree | b5c90b93698c8b4e5512c05f42ffbebc08c6b48c /lib | |
parent | 96f3d62ce86d49c909472a4165e213aa74b2d1a5 (diff) | |
parent | c8b455faee0c809921a875082486f04937c2901c (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('?') |