From 57525b6450f2368c4866c8324de36b377bf39f54 Mon Sep 17 00:00:00 2001 From: daniel goldberg Date: Thu, 25 Aug 2016 16:32:16 +0300 Subject: [PATCH] Moved to using HEAD to save code --- chaos_monkey/network/httpfinger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chaos_monkey/network/httpfinger.py b/chaos_monkey/network/httpfinger.py index b6f9ad887..52b29d3bb 100644 --- a/chaos_monkey/network/httpfinger.py +++ b/chaos_monkey/network/httpfinger.py @@ -17,7 +17,7 @@ class HTTPFinger(HostFinger): def get_host_fingerprint(self, host): assert isinstance(host, VictimHost) - from requests import get + from requests import head from requests.exceptions import Timeout, ConnectionError from contextlib import closing @@ -29,7 +29,7 @@ class HTTPFinger(HostFinger): # try http, we don't optimise for 443 for url in (https, http): # start with https and downgrade try: - with closing(get(url, verify=False, timeout=1, stream=True)) as req: + with closing(head(url, verify=False, timeout=1)) as req: server = req.headers.get('Server') ssl = True if 'https://' in url else False host.services['tcp-' + port[1]] = (server,ssl)