Skip to content

Commit f03ed84

Browse files
committed
fix https bug
1 parent dcbccf7 commit f03ed84

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/http_parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def req_to_urlinfo(req):
9191
url_info["ssl"] = True
9292
url_info["base_url"] = "https://{0}".format(url_info["host"])
9393
if ":" not in url_info["host"]:
94-
url_info["port"] = url_info["443"]
94+
url_info["port"] = 443
9595
else:
9696
url_info["ssl"] = False
9797
url_info["base_url"] = "http://{0}".format(url_info["host"])
@@ -193,9 +193,10 @@ def rsp_to_req_dict(response):
193193
def get_res_req_by_url(url):
194194
headers = dict()
195195
headers["User-Agent"] = Utils.get_random_ua()
196+
headers["Connection"] = "close"
196197
try:
197198
response = requests.get(url,headers=headers,timeout=10)
198199
return HTTPParser.rsp_to_dict(response), HTTPParser.rsp_to_req_dict(response)
199200
except:
200201
logger.debug(traceback.format_exc())
201-
return None, None
202+
return None, None

0 commit comments

Comments
 (0)