Skip to content

fix(api): support wildcard CORS origins for Vercel previews (FRO-61)#35

Merged
pierrick-fonquerne merged 2 commits intodevelopfrom
fix/deployment
Jan 19, 2026
Merged

fix(api): support wildcard CORS origins for Vercel previews (FRO-61)#35
pierrick-fonquerne merged 2 commits intodevelopfrom
fix/deployment

Conversation

@pierrick-fonquerne
Copy link
Copy Markdown
Owner

  • Use SetIsOriginAllowed() instead of WithOrigins() to support wildcards
  • Add regex pattern matching for origins containing '*'
  • Support exact match for non-wildcard origins
  • Case-insensitive origin comparison

This allows Railway backend to accept requests from:

Build: ✓ (0 warnings, 0 errors)
Tests: ✓ (157 passed - 113 unit + 44 integration)

- Use SetIsOriginAllowed() instead of WithOrigins() to support wildcards
- Add regex pattern matching for origins containing '*'
- Support exact match for non-wildcard origins
- Case-insensitive origin comparison

This allows Railway backend to accept requests from:
- https://staging.fantasy-realm.com (exact match)
- https://*.vercel.app (wildcard match for all Vercel preview deployments)
- http://localhost:5173 (local development)

Build: ✓ (0 warnings, 0 errors)
Tests: ✓ (157 passed - 113 unit + 44 integration)
@vercel
Copy link
Copy Markdown

vercel bot commented Jan 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
fantasyrealm-character-manager Ready Ready Preview, Comment Jan 19, 2026 1:52pm

@pierrick-fonquerne pierrick-fonquerne merged commit 988c3e6 into develop Jan 19, 2026
6 checks passed
@pierrick-fonquerne pierrick-fonquerne deleted the fix/deployment branch January 19, 2026 14:14
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