Skip to content

Wildcard cors for server not allowed #28927

@ducng99

Description

@ducng99

Description

I am spawning multiple opencode servers with random ports and access them using one web instance.
However, starting opencode server with a wildcard cors does not work as it only checks for direct match.

opencode serve --cors "*"

Not providing cors flag causes the browser to just block the request due to missing CORS headers.

Plugins

No response

OpenCode version

1.15.9

Steps to reproduce

  1. Start opencode server with any cors config
  2. Launch a website of some kind
  3. Call fetch() in the browser to the opencode server
  4. Error for ‘Access-Control-Allow-Origin’ missing

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions