Content-Length: 309578 | pFad | http://github.com/interactions-py/interactions.py/commit/de72911ff61011a2bcbec353f470eb52e164f5ef

BA fix: properly pass in proxy to http client (#1544) · interactions-py/interactions.py@de72911 · GitHub
Skip to content

Commit de72911

Browse files
authored
fix: properly pass in proxy to http client (#1544)
This also fixes the typehint for the http client
1 parent c9f43c0 commit de72911

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: interactions/api/http/http_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def __init__(
218218
connector: BaseConnector | None = None,
219219
logger: Logger = MISSING,
220220
show_ratelimit_tracebacks: bool = False,
221-
proxy: tuple[str, BasicAuth] | None = None,
221+
proxy: tuple[str | None, BasicAuth | None] | None = None,
222222
) -> None:
223223
self.connector: BaseConnector | None = connector
224224
self.__session: ClientSession | None = None
@@ -233,7 +233,7 @@ def __init__(
233233
self.user_agent: str = (
234234
f"DiscordBot ({__repo_url__} {__version__} Python/{__py_version__}) aiohttp/{aiohttp.__version__}"
235235
)
236-
self.proxy: tuple[str, BasicAuth] | None = proxy
236+
self.proxy: tuple[str | None, BasicAuth | None] | None = proxy
237237
self.__proxy_validated: bool = False
238238

239239
if logger is MISSING:

Diff for: interactions/client/client.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,9 @@ def __init__(
348348
if isinstance(proxy_auth, tuple):
349349
proxy_auth = BasicAuth(*proxy_auth)
350350

351+
proxy = (proxy_url, proxy_auth) if proxy_url or proxy_auth else None
351352
self.http: HTTPClient = HTTPClient(
352-
logger=self.logger, show_ratelimit_tracebacks=show_ratelimit_tracebacks, proxy=(proxy_url, proxy_auth)
353+
logger=self.logger, show_ratelimit_tracebacks=show_ratelimit_tracebacks, proxy=proxy
353354
)
354355
"""The HTTP client to use when interacting with discord endpoints"""
355356

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/interactions-py/interactions.py/commit/de72911ff61011a2bcbec353f470eb52e164f5ef

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy