Skip to content

fix: make CORS rejects visible on relay and in invite toasts - #3878

Open
Chessing234 wants to merge 6 commits into
block:mainfrom
Chessing234:fix/cors-preflight-visibility
Open

Chessing234 wants to merge 6 commits into
block:mainfrom
Chessing234:fix/cors-preflight-visibility

Conversation

@Chessing234

Copy link
Copy Markdown
Contributor

Summary

  • Move the HTTP trace layer outside CORS so rejected preflights still produce spans/logs.
  • Warn with the received Origin and configured BUZZ_CORS_ORIGINS allowlist on reject.
  • Split invite mint vs clipboard errors in Desktop so network/CORS failures are not reported as clipboard problems.
  • Document Desktop webview origins in compose .env.example / README.

Fixes #3636

Test plan

  • cargo test -p buzz-relay --lib cors_origin
  • Deploy compose with CORS missing http://tauri.localhost, mint an invite from Desktop — relay logs CORS rejected origin, toast says create failed (not clipboard)
  • Add the tauri origins, recreate containers, invite mint + copy succeeds

Made with Cursor

Rejected preflights never reached the trace layer before, so self-host CORS
misconfig produced zero relay logs (block#3636).

Signed-off-by: Taksh <takshkothari09@gmail.com>
Log the received Origin and the configured BUZZ_CORS_ORIGINS allowlist so
operators can fix desktop webview origins in minutes instead of hours.

Signed-off-by: Taksh <takshkothari09@gmail.com>
A CORS/network failure on mintInvite was reported as a clipboard problem,
which sent self-hosters down the wrong rabbit hole (block#3636).

Signed-off-by: Taksh <takshkothari09@gmail.com>
Point operators at the new reject log line and the recreate-after-env-change
requirement.

Signed-off-by: Taksh <takshkothari09@gmail.com>
@Chessing234
Chessing234 requested a review from a team as a code owner July 31, 2026 08:30
Self-hosters who only allow the public https origin hit silent invite
failures from the Tauri webview; name the required extras in .env.example.

Signed-off-by: Taksh <takshkothari09@gmail.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

@tlongwell-block @wesbillman @wpfleger96 mind taking a look when you get a chance?

@Chessing234
Chessing234 force-pushed the fix/cors-preflight-visibility branch from dcf4f8f to badbd1f Compare August 5, 2026 10:36
Signed-off-by: Taksh <takshkothari09@gmail.com>
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 59328d5ae38a51a618dd2fddd7faf1343d42096f...9a4e4ff4bec91db8038b27abd2de05db9b70ed86.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 9a4e4ff4bec91db8038b27abd2de05db9b70ed86 to authorize a new review.
Any previous review applies only to its recorded range.

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.

A rejected CORS preflight is invisible on both sides: no relay log at any level, and the desktop reports it as a clipboard failure

1 participant