Persist one browser user agent for Axios and WebSockets

This commit is contained in:
Brandon Li
2026-10-19 06:08:23 -05:00
parent 13e03c3d0f
commit ed56e306d1
21 changed files with 380 additions and 64 deletions
+1 -2
View File
@@ -19,7 +19,7 @@
* entry path asks spreadBlock before sending.
*/
import axios from 'axios';
import axios from './http-client';
import { getInstruments, getSetting } from './db';
import { getTradableFirms, getTradingSettings } from './firm-catalog';
import { entrySpread, quoteSource } from './live-quotes';
@@ -98,7 +98,6 @@ async function fetchMarket(root: string): Promise<void> {
try {
const res = await axios.get(`https://query1.finance.yahoo.com/v8/finance/chart/${encodeURIComponent(spec.yahoo)}`, {
params: { interval: '60m', range: '7d' },
headers: { 'User-Agent': 'Mozilla/5.0' },
timeout: FETCH_TIMEOUT_MS,
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS + 5_000),
});