amfoss / amfoss/root

Add dynamic CORS middleware to support Vercel preview domains

Offen
#151 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
4
Forks
23
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

When deploying frontend previews on Vercel, each branch or pull request is assigned a unique preview URL (e.g., https://home-git-fork-harshith-2208-develop-amfoss-dev.vercel.app/dashboard).

However, since CORS does not natively support URL wildcards, backend requests from these dynamically generated subdomains fail unless each preview URL is explicitly whitelisted. This breaks API requests during development and review stages.

## Expected Behavior

Requests originating from any Vercel preview domain (i.e. *.vercel.app) should be accepted without needing manual updates to the CORS whitelist.

## Proposed Solution

* Implement a custom CORS middleware in the backend that:
* Dynamically validates incoming Origin headers.
* Uses regex or pattern matching to allow origins that match the Vercel preview URL format:

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.