dm / commit
fix: use correct CORS header for direct browser API access
public/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index 96dbc63..006bd46 100644 --- a/public/index.html +++ b/public/index.html @@ -1683,12 +1683,12 @@ async function sendMessage(text, showAsPlayer = true) { 'Content-Type': 'application/json', 'x-api-key': gameState.apiKey, 'anthropic-version': '2023-06-01', - 'anthropic-dangerous-allow-browser': 'true', + 'anthropic-dangerous-direct-browser-access': 'true', }, body: JSON.stringify(requestBody), }); } catch (fetchErr) { - // fetch() itself threw — almost always a CORS preflight failure or network issue + // fetch() itself threw — CORS preflight rejected or network down console.error('🔴 fetch() threw (CORS / network):', fetchErr); throw new Error( `Network error — could not reach Anthropic. Likely causes:\n` +