mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-28 08:04:13 +08:00
zstd
This commit is contained in:
parent
27b6f0e1ba
commit
a5ab730669
@ -54,6 +54,9 @@ def ExceptionFilter(func):
|
||||
|
||||
|
||||
class Requester(Requester_common):
|
||||
|
||||
Accept_Encoding = "gzip, deflate, br, zstd"
|
||||
|
||||
def raise_for_status(self):
|
||||
if self.last_error:
|
||||
raise CURLException(self.last_error)
|
||||
|
@ -119,6 +119,7 @@ class ResponseBase:
|
||||
|
||||
|
||||
class Requester_common:
|
||||
Accept_Encoding = "gzip, deflate, br"
|
||||
|
||||
def request(self, *argc) -> ResponseBase: ...
|
||||
|
||||
@ -277,7 +278,9 @@ class Session:
|
||||
verify=False,
|
||||
cert=None,
|
||||
):
|
||||
requester = self.loadrequester()
|
||||
_h = self.headers.copy()
|
||||
_h.update({"Accept-Encoding": requester.Accept_Encoding})
|
||||
if headers:
|
||||
_h.update(headers)
|
||||
headers = _h
|
||||
@ -307,7 +310,7 @@ class Session:
|
||||
timeout = None
|
||||
if cookies:
|
||||
self.cookies.update(cookies)
|
||||
response = self.loadrequester().request(
|
||||
response = requester.request(
|
||||
method,
|
||||
scheme,
|
||||
server,
|
||||
|
Loading…
x
Reference in New Issue
Block a user