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:
@@ -48,7 +48,8 @@ defmodule ArcadiaCloudWeb.Endpoint do
|
||||
|
||||
plug CORSPlug,
|
||||
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$}
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user