Skip to content

Commit bf739f8

Browse files
committed
Empty host fix
1 parent 0d7ea31 commit bf739f8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

http/requests/proxy/requestProxy.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ def generate_proxied_request(self, url, params={}, req_timeout=30):
6060
req_headers = dict(params.items() + self.generate_random_request_headers().items())
6161

6262
rand_proxy = random.choice(self.proxy_list)
63+
while not rand_proxy:
64+
rand_proxy = random.choice(self.proxy_list)
65+
6366
print "Using proxy: {0}".format(str(rand_proxy))
6467
request = requests.get(url, proxies={"http": rand_proxy},
6568
headers=req_headers, timeout=req_timeout)

0 commit comments

Comments
 (0)