mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
6f183b975a
commit
836c747bde
@ -210,15 +210,14 @@ class Session(Sessionbase):
|
|||||||
cnt -= 1
|
cnt -= 1
|
||||||
if cnt == 0:
|
if cnt == 0:
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
# 有proxy时,proxy也有可能有header.
|
||||||
|
headerb = ""
|
||||||
else:
|
else:
|
||||||
headerb += _headerb
|
headerb += _headerb
|
||||||
|
|
||||||
resp.headers = self._update_header_cookie(headerb)
|
resp.headers = self._update_header_cookie(headerb)
|
||||||
|
resp.status_code = self._getStatusCode(curl)
|
||||||
if proxy:
|
|
||||||
resp.status_code = int(headerb[:-2].split(" ")[1])
|
|
||||||
else:
|
|
||||||
resp.status_code = self._getStatusCode(curl)
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
def WriteMemoryCallback(saver, contents, size, nmemb, userp):
|
def WriteMemoryCallback(saver, contents, size, nmemb, userp):
|
||||||
|
@ -238,6 +238,8 @@ class Sessionbase:
|
|||||||
cookie = {}
|
cookie = {}
|
||||||
for line in headerstr.split("\r\n")[1:]:
|
for line in headerstr.split("\r\n")[1:]:
|
||||||
idx = line.find(": ")
|
idx = line.find(": ")
|
||||||
|
if idx == -1:
|
||||||
|
continue
|
||||||
if line[:idx].lower() == "set-cookie":
|
if line[:idx].lower() == "set-cookie":
|
||||||
_c = line[idx + 2 :].split("; ")[0]
|
_c = line[idx + 2 :].split("; ")[0]
|
||||||
_idx = _c.find("=")
|
_idx = _c.find("=")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user