Skip to content

test(server): cover desktop-origin CORS on environment descriptor GET - #4

Closed
matsvarn wants to merge 1 commit into
mainfrom
cursor/fix-packaged-descriptor-cors-537d
Closed

test(server): cover desktop-origin CORS on environment descriptor GET#4
matsvarn wants to merge 1 commit into
mainfrom
cursor/fix-packaged-descriptor-cors-537d

Conversation

@matsvarn

@matsvarn matsvarn commented Aug 16, 2026

Copy link
Copy Markdown
Owner

What Changed

Adds two regression tests on the real makeRoutesLayer descriptor route:

  • GET /.well-known/t3/environment from the desktop renderer origin (t3code://app) with Chromium Accept-Encoding
  • matching OPTIONS preflight from that origin

No production code change. Packaged policy stays wildcard ACAO without credentials.

Fixes pingdotgg#7102

Why

#7102 reported that packaged nightly 0.0.34-nightly.20260815.1101 returned 200 JSON for the environment descriptor but omitted Access-Control-Allow-Origin on the GET, while OPTIONS 204 included it. Desktop pairing to remote environments then failed in Chromium. Web same-origin pairing still worked.

On current main, apps/server/dist/bin.mjs already returns ACAO on that GET (evidence from a packaged local serve + curl with Origin: t3code://app). pingdotgg#2594 added CORS at source; pingdotgg#2858 moved the descriptor onto HttpApi and left HttpRouter.cors() (browserApiCorsLayer) as the GET/OPTIONS interface. That interface works in this pack.

The existing server test used a generic origin and no Accept-Encoding, so it did not lock the desktop Chromium request shape. These tests do. Re-implementing pingdotgg#2594 would duplicate a fix that is already present.

Root cause of the nightly report is inference: a stale or different artifact than this main pack, or a proxy path not reproduced here. Origin-server GET CORS on this checkout is evidence.

UI Changes

No UI changes.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes
Open in Web Open in Cursor 

Packaged nightly pingdotgg#7102 reported missing ACAO on GET /.well-known/t3/environment
while OPTIONS still sent it. Current main already returns ACAO on that GET,
including from t3code://app with Accept-Encoding. Lock GET and OPTIONS on the
real descriptor route so a middleware regression is red without re-implementing pingdotgg#2594.

Co-authored-by: Mats Varnskühler <imMxts@users.noreply.github.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Aug 16, 2026
@matsvarn

Copy link
Copy Markdown
Owner Author

Superseded by the real-repo draft: pingdotgg#7248 (Fixes pingdotgg#7102). Closing this fork-only PR so the issue links to one place.

@matsvarn matsvarn closed this Aug 16, 2026
@cursor
cursor Bot deleted the cursor/fix-packaged-descriptor-cors-537d branch August 16, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Packaged nightly omits CORS header on environment descriptor GET

2 participants