Skip to content

test: cover companion localhost CORS and OPTIONS preflight - #13

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/test-coverage-automation-fef1
Draft

test: cover companion localhost CORS and OPTIONS preflight#13
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/test-coverage-automation-fef1

Conversation

@cursor

@cursor cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Risky behavior now covered

  • Localhost / 127.0.0.1 control-plane origins rejected by companion CORS
  • Browser OPTIONS preflight on /sessions and /commands blocked when no x-webchain-token is present

Test files added/updated

  • services/companion/src/server.test.ts

Why these tests materially reduce regression risk

CORS allowlist + preflight are the gate for every browser→companion call; reject-path was already tested, but allow/preflight regressions would break the local browser loop without failing runtime unit tests.

Validation

  • pnpm --filter @webchain/companion test (15 tests passed)
Open in Web View Automation 

Pin allowlist for localhost/127.0.0.1 origins and ensure protected
route preflight succeeds without a local token.

Co-authored-by: esadrianno <esadrianno@gmail.com>
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