fix(SearchAssembly64): update client-id header to match server requirements

This commit is contained in:
Jaime Idolpx 2026-06-14 04:55:28 -04:00
parent 9a902d6b4f
commit 65be5615ad

View File

@ -14,7 +14,11 @@ const DOWNLOAD_DIR = '/sd/downloads';
function leetFetch(path: string, query?: Record<string, string>) { function leetFetch(path: string, query?: Record<string, string>) {
const url = new URL(LEET_BASE + path); const url = new URL(LEET_BASE + path);
if (query) Object.entries(query).forEach(([k, v]) => url.searchParams.set(k, v)); if (query) Object.entries(query).forEach(([k, v]) => url.searchParams.set(k, v));
return fetch(url.toString(), { headers: { 'client-id': 'swagger' } }); // The server whitelists "Client-Id: Ultimate" (the 1541 Ultimate
// cartridge) and rejects unknown client ids with HTTP 464. The server
// also advertises "client-id" in Access-Control-Allow-Headers, so the
// preflight that this custom header triggers is allowed.
return fetch(url.toString(), { headers: { 'Client-Id': 'Ultimate' } });
} }
async function leetJson<T>(path: string, query?: Record<string, string>): Promise<T> { async function leetJson<T>(path: string, query?: Record<string, string>): Promise<T> {