Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Add trust_env to AIOHTTP ClientSession Initialization to Read .env for Proxy Mapping #6640

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openbb_platform/core/openbb_core/provider/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async def amake_request(
)

with_session = kwargs.pop("with_session", "session" in kwargs)
session: ClientSession = kwargs.pop("session", ClientSession())
session: ClientSession = kwargs.pop("session", ClientSession(trust_env=True))

try:
response = await session.request(method, url, **kwargs)
Expand Down Expand Up @@ -175,7 +175,7 @@ async def amake_requests(
Union[dict, List[dict]]
Response json
"""
session: ClientSession = kwargs.pop("session", ClientSession())
session: ClientSession = kwargs.pop("session", ClientSession(trust_env=True))
kwargs["response_callback"] = response_callback

urls = urls if isinstance(urls, list) else [urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ async def download_plotly_js():
# we use aiohttp to download plotly.js
# this is so we don't have to block the main thread
async with aiohttp.ClientSession(
connector=aiohttp.TCPConnector(verify_ssl=False)
connector=aiohttp.TCPConnector(verify_ssl=False), trust_env=True
) as session, session.get(f"https://cdn.plot.ly/{js_filename}") as resp:
with open(str(PLOTLYJS_PATH), "wb") as f:
while True:
Expand Down
Loading