From f43681ebe8940e0a6968789db41b33b129fd0869 Mon Sep 17 00:00:00 2001 From: Eugene Klimov Date: Fri, 15 Jan 2016 16:44:48 +0300 Subject: [PATCH 1/2] Fix wrong Host header detection after update my funkload test is broken with errror File "/usr/local/lib/python2.7/dist-packages/funkload/PatchWebunit.py", line 391, in WF_fetch if not webproxy and not 'Host' in self.extra_headers.keys(): AttributeError: 'list' object has no attribute 'keys' --- src/funkload/PatchWebunit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/funkload/PatchWebunit.py b/src/funkload/PatchWebunit.py index ffa8abe9..92edcb03 100644 --- a/src/funkload/PatchWebunit.py +++ b/src/funkload/PatchWebunit.py @@ -388,7 +388,7 @@ def WF_fetch(self, url, postdata=None, server=None, port=None, protocol=None, headers.append(('Authorization', "Basic %s"%self.authinfo)) #If a value is specified for 'Host' then another value should not be appended - if not webproxy and not 'Host' in self.extra_headers.keys(): + if not webproxy and 'Host' not in self.extra_headers: # HTTPConnection seems to add a host header itself. # So we only need to do this if we are not using a proxy. headers.append(('Host', host_header)) From febfc598ed759ea17871e94fc144828b7044fc1e Mon Sep 17 00:00:00 2001 From: Eugene Klimov Date: Thu, 21 Jan 2016 17:57:46 +0300 Subject: [PATCH 2/2] Fix wrong Host header detection after pull request conversation --- src/funkload/PatchWebunit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/funkload/PatchWebunit.py b/src/funkload/PatchWebunit.py index 92edcb03..6a15ab7e 100644 --- a/src/funkload/PatchWebunit.py +++ b/src/funkload/PatchWebunit.py @@ -388,7 +388,7 @@ def WF_fetch(self, url, postdata=None, server=None, port=None, protocol=None, headers.append(('Authorization', "Basic %s"%self.authinfo)) #If a value is specified for 'Host' then another value should not be appended - if not webproxy and 'Host' not in self.extra_headers: + if not webproxy and 'Host' not in dict(self.extra_headers): # HTTPConnection seems to add a host header itself. # So we only need to do this if we are not using a proxy. headers.append(('Host', host_header))