Repository navigation
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #37932: fix(console): add CORS headers and OPTIONS preflight to Zen/Go API endpoints Why it might be related:
You should verify if #37932 is already merged or if it addresses the same issue (#41224). If it's closed/merged without fixing the issue, that explains why the current PR was needed. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #41224
Type of change
What does this PR do?
Adds CORS headers to actual Zen model-list responses, not only OPTIONS preflight responses. The shared helper is also used by the main Zen chat handler response headers so normal GET/POST responses include
Access-Control-Allow-Originas browsers require after a successful preflight.This keeps the existing permissive preflight policy (
*,GET, POST, OPTIONS,Content-Type, Authorization) and applies it to actual API responses.How did you verify your code works?
cd packages/console/app && bun test test/zenCors.test.ts --timeout 30000cd packages/console/app && bun run typecheckbunx oxlint packages/console/app/src/routes/zen/util/modelsHandler.ts packages/console/app/src/routes/zen/util/handler.ts packages/console/app/test/zenCors.test.tsgit diff --checkScreenshots / recordings
N/A; this is a response-header fix.
Checklist