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 | 470c60f5f84f359783763e9a2aaa13b77f2ebacd (patch) | |
tree | 6c5f9eb5cf3972cd20ab15dedc3ea752449a32dd /lib | |
parent | 8a51bec9f458270ee21d501555213527df284403 (diff) | |
parent | 94dae912e6fdd2ca21f90c395b8dd6c07393d3c1 (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('?') |