Broaden dev CORS to any localhost port

skyai-cloud's Vite dev server hops ports (5173 -> 5174 -> ...) when one
is taken, so a fixed localhost:5173 allowlist breaks the browser's
cross-origin calls. Allow any http://localhost:<port> in dev; the
*.sky-ai.com rule is unchanged for deployed origins.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 18:09:13 +10:00
parent 6ec7e9b93a
commit 741692c7d7

View File

@@ -48,7 +48,8 @@ defmodule ArcadiaCloudWeb.Endpoint do
plug CORSPlug, plug CORSPlug,
origin: [ origin: [
"http://localhost:5173", # any localhost port — Vite dev servers hop ports when one is taken
~r{^http://localhost:\d+$},
~r{^https://.*\.sky-ai\.com$} ~r{^https://.*\.sky-ai\.com$}
] ]