fix(SearchAssembly64): update client-id header to match server requirements
This commit is contained in:
parent
9a902d6b4f
commit
65be5615ad
|
|
@ -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> {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user