bugfix
This commit is contained in:
parent
982ea828fd
commit
003ff36471
@ -150,6 +150,8 @@ class HttpClient:
|
|||||||
|
|
||||||
if headers == {}:
|
if headers == {}:
|
||||||
headers = None
|
headers = None
|
||||||
|
ssl_ctx = None
|
||||||
|
if url.startswith('https://'):
|
||||||
ssl_ctx = ssl.create_default_context(cafile=certifi.where())
|
ssl_ctx = ssl.create_default_context(cafile=certifi.where())
|
||||||
return await session.request(method, url,
|
return await session.request(method, url,
|
||||||
params=params,
|
params=params,
|
||||||
@ -166,7 +168,9 @@ class HttpClient:
|
|||||||
headers=None,
|
headers=None,
|
||||||
**kw
|
**kw
|
||||||
):
|
):
|
||||||
|
domain = get_domain(url)
|
||||||
try:
|
try:
|
||||||
|
if self.socks5_proxy_url is None or domain not in self.blocked_domains:
|
||||||
return await self.make_request(url, method=method,
|
return await self.make_request(url, method=method,
|
||||||
params=params,
|
params=params,
|
||||||
data=data,
|
data=data,
|
||||||
@ -179,7 +183,6 @@ class HttpClient:
|
|||||||
exception(f'{e=}, {format_exc()}')
|
exception(f'{e=}, {format_exc()}')
|
||||||
if self.socks5_proxy_url is None:
|
if self.socks5_proxy_url is None:
|
||||||
raise e
|
raise e
|
||||||
domain = get_domain(url)
|
|
||||||
debug(f'{self.socks5_proxy_url=}, {self.blocked_domains=}, {domain=}')
|
debug(f'{self.socks5_proxy_url=}, {self.blocked_domains=}, {domain=}')
|
||||||
if domain not in self.blocked_domains:
|
if domain not in self.blocked_domains:
|
||||||
self.blocked_domains.add(domain)
|
self.blocked_domains.add(domain)
|
||||||
|
Loading…
Reference in New Issue
Block a user