Skip to content

Fix fetch credentials option casing#4

Open
tristanmanchester wants to merge 1 commit intoopenai:mainfrom
tristanmanchester:fix-fetch-credentials
Open

Fix fetch credentials option casing#4
tristanmanchester wants to merge 1 commit intoopenai:mainfrom
tristanmanchester:fix-fetch-credentials

Conversation

@tristanmanchester
Copy link
Copy Markdown

Summary

  • Change the affected fetch request option objects from the ignored Credentials property to the standard lowercase credentials property.
  • Add explicit RequestInit annotations so TypeScript validates these objects against the browser fetch API contract.
  • Covers the backend JSONL fetch, renderer list refresh, and translation request paths that were intended to send credentials.

Bug

fetch only reads RequestInit.credentials; JavaScript object keys are case-sensitive, so Credentials: 'include' is treated as an unrelated property and silently ignored. For cross-origin deployments this leaves the request at the browser default credentials behavior, so cookies and other credentials are not included even though the server enables credentialed CORS.

Fix

Updated the three affected request option objects:

  • src/utils/api-manager.ts JSONL fetch
  • src/utils/api-manager.ts renderer list refresh
  • src/components/app/request-worker.ts translation request

Each now uses credentials: 'include' and is typed as RequestInit, which prevents future casing or value mistakes from bypassing TypeScript.

Verification

  • Searched src for remaining uppercase Credentials: request options; none remain.
  • Ran pnpm run build successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant