mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-05-06 22:12:12 +08:00
[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
This commit is contained in:
2
desktop/src/routes/api-keys.tsx
vendored
2
desktop/src/routes/api-keys.tsx
vendored
@@ -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.");
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user