From 46cb90477602f7cdaed90066d70cbf38a007e7c2 Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Thu, 5 Mar 2026 11:11:54 -0800 Subject: [PATCH] [BugFix] Update `get_user_agent` Utility With Modern User Agent Strings (#7398) * update get_user_agent utility with modern user agent strings and add explicit headers to svensson_yield_curve * no need to add step in svensson_yield_curve * remove the comment that is breaking codespell for some reason --- desktop/src/routes/api-keys.tsx | 2 +- .../core/openbb_core/provider/utils/client.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/desktop/src/routes/api-keys.tsx b/desktop/src/routes/api-keys.tsx index 44aaba00fb4..3b780e8c2d5 100644 --- a/desktop/src/routes/api-keys.tsx +++ b/desktop/src/routes/api-keys.tsx @@ -129,7 +129,7 @@ export default function ApiKeysPage() { if (newKeys.length > 0) { setImportedKeys(newKeys); - setSelectedKeys(new Set(newKeys.map((k) => k.key))); // Pre-select all + setSelectedKeys(new Set(newKeys.map((k) => k.key))); setIsImportConfirmModalOpen(true); } else { setError("No new keys found in the imported file."); diff --git a/openbb_platform/core/openbb_core/provider/utils/client.py b/openbb_platform/core/openbb_core/provider/utils/client.py index 1ccbe5fe58e..bc874c1c438 100644 --- a/openbb_platform/core/openbb_core/provider/utils/client.py +++ b/openbb_platform/core/openbb_core/provider/utils/client.py @@ -26,13 +26,13 @@ def obfuscate(params: CIMultiDict[str] | MultiDict[str]) -> dict[str, Any]: def get_user_agent() -> str: """Get a not very random user agent.""" user_agent_strings = [ - "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.10; rv:86.1) Gecko/20100101 Firefox/86.1", - "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:86.1) Gecko/20100101 Firefox/86.1", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:82.1) Gecko/20100101 Firefox/82.1", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:86.0) Gecko/20100101 Firefox/86.0", - "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:86.0) Gecko/20100101 Firefox/86.0", - "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.10; rv:83.0) Gecko/20100101 Firefox/83.0", - "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:84.0) Gecko/20100101 Firefox/84.0", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36", # noqa: E501 # pylint: disable=line-too-long + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36", # noqa: E501 # pylint: disable=line-too-long + "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0", # noqa: E501 # pylint: disable=line-too-long + "Mozilla/5.0 (Macintosh; Intel Mac OS X 14.7; rv:133.0) Gecko/20100101 Firefox/133.0", # noqa: E501 # pylint: disable=line-too-long + "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15", # noqa: E501 # pylint: disable=line-too-long + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0", # noqa: E501 # pylint: disable=line-too-long + "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36", # noqa: E501 # pylint: disable=line-too-long ] return random.choice(user_agent_strings) # nosec # noqa: S311