[PR #1218] [CLOSED] feat(serve): add CORS origins configuration support #9850

Closed
opened 2026-02-16 18:14:16 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1218
Author: @braden-w
Created: 7/22/2025
Status: Closed

Base: devHead: feat/cors-origins


📝 Commits (8)

  • 0e1491a feat(serve): add CORS origins configuration support
  • d6a8309 Merge branch 'dev' into feat/cors-origins
  • 84ffd2a fix(serve): set default empty array for cors-origins option
  • ec93cad Merge remote-tracking branch 'origin/dev' into feat/cors-origins
  • 2bf3101 Merge branch 'dev' into feat/cors-origins
  • a867630 chore(deps): bun.lock
  • b692546 fix(session): correct text event type from text-delta to text
  • 4b7512f Merge remote-tracking branch 'upstream/dev' into feat/cors-origins

📊 Changes

3 files changed (+18 additions, -6 deletions)

View changed files

📝 packages/opencode/src/cli/cmd/serve.ts (+8 -0)
📝 packages/opencode/src/server/server.ts (+9 -5)
📝 packages/opencode/src/session/index.ts (+1 -1)

📄 Description

Add --cors-origins flag to serve command allowing specification of allowed CORS origins for cross-origin requests. When no origins are specified, defaults to same-origin only for security.

Usage:

opencode serve --cors-origins "http://localhost:3000" "https://myapp.com"
opencode serve -c "http://localhost:3000"

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1218 **Author:** [@braden-w](https://github.com/braden-w) **Created:** 7/22/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `feat/cors-origins` --- ### 📝 Commits (8) - [`0e1491a`](https://github.com/anomalyco/opencode/commit/0e1491a9c217a2822917f92a0a699e6187262de4) feat(serve): add CORS origins configuration support - [`d6a8309`](https://github.com/anomalyco/opencode/commit/d6a8309c0bbf25bb4b942f731f65fff5d092e18c) Merge branch 'dev' into feat/cors-origins - [`84ffd2a`](https://github.com/anomalyco/opencode/commit/84ffd2ac3c6076c914b932f668727d4d74ef47cd) fix(serve): set default empty array for cors-origins option - [`ec93cad`](https://github.com/anomalyco/opencode/commit/ec93cad06e9885f1b38fcefe4245bdbd490df329) Merge remote-tracking branch 'origin/dev' into feat/cors-origins - [`2bf3101`](https://github.com/anomalyco/opencode/commit/2bf310121ad70d7f2ca14255e50cfab0c9dca800) Merge branch 'dev' into feat/cors-origins - [`a867630`](https://github.com/anomalyco/opencode/commit/a867630e9ede6d9cc78207f9c7f3449a0b044161) chore(deps): bun.lock - [`b692546`](https://github.com/anomalyco/opencode/commit/b692546e48c13cbb76999bad1e7c854563ccb922) fix(session): correct text event type from text-delta to text - [`4b7512f`](https://github.com/anomalyco/opencode/commit/4b7512fd12ec1bc927e74f9267acf9cea93abb2c) Merge remote-tracking branch 'upstream/dev' into feat/cors-origins ### 📊 Changes **3 files changed** (+18 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/cli/cmd/serve.ts` (+8 -0) 📝 `packages/opencode/src/server/server.ts` (+9 -5) 📝 `packages/opencode/src/session/index.ts` (+1 -1) </details> ### 📄 Description Add --cors-origins flag to serve command allowing specification of allowed CORS origins for cross-origin requests. When no origins are specified, defaults to same-origin only for security. Usage: ```bash opencode serve --cors-origins "http://localhost:3000" "https://myapp.com" opencode serve -c "http://localhost:3000" ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:16 -05:00
yindo closed this issue 2026-02-16 18:14:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9850