mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
parent
c9aa5a102d
commit
4800d415ae
@ -13,7 +13,6 @@ except:
|
|||||||
print_exc()
|
print_exc()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Response(ResponseBase):
|
class Response(ResponseBase):
|
||||||
def iter_content_impl(self, chunk_size=1):
|
def iter_content_impl(self, chunk_size=1):
|
||||||
availableSize = DWORD()
|
availableSize = DWORD()
|
||||||
@ -48,6 +47,11 @@ class Response(ResponseBase):
|
|||||||
|
|
||||||
|
|
||||||
class Requester(Requester_common):
|
class Requester(Requester_common):
|
||||||
|
def request(self, *argc, **kwarg) -> ResponseBase:
|
||||||
|
if kwarg["stream"]:
|
||||||
|
# winhttp流式时,没办法判断解压边界
|
||||||
|
kwarg["headers"].pop("Accept-Encoding")
|
||||||
|
return super().request(*argc, **kwarg)
|
||||||
|
|
||||||
def _getheaders(self, hreq):
|
def _getheaders(self, hreq):
|
||||||
dwSize = DWORD()
|
dwSize = DWORD()
|
||||||
|
@ -413,20 +413,20 @@ class Session:
|
|||||||
response = requester.request(
|
response = requester.request(
|
||||||
method.upper(),
|
method.upper(),
|
||||||
url,
|
url,
|
||||||
params,
|
params=params,
|
||||||
data,
|
data=data,
|
||||||
_h,
|
headers=_h,
|
||||||
proxies,
|
proxies=proxies,
|
||||||
json,
|
json=json,
|
||||||
self.cookies,
|
cookies=self.cookies,
|
||||||
files,
|
files=files,
|
||||||
auth,
|
auth=auth,
|
||||||
timeout,
|
timeout=timeout,
|
||||||
allow_redirects,
|
allow_redirects=allow_redirects,
|
||||||
hooks,
|
hooks=hooks,
|
||||||
stream,
|
stream=stream,
|
||||||
verify,
|
verify=verify,
|
||||||
cert,
|
cert=cert,
|
||||||
)
|
)
|
||||||
self.cookies.update(response.cookies)
|
self.cookies.update(response.cookies)
|
||||||
response.cookies.update(self.cookies)
|
response.cookies.update(self.cookies)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user