mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 06:41:08 +02:00
fix: allow localhost in CSP connect-src during development
Dev env vars (_CLIENT suffixed) are empty, so localhost:3001 (auth), localhost:3050 (sync), localhost:3060 (api) were blocked by CSP. Added http://localhost:* and ws://localhost:* to connect-src when NODE_ENV !== 'production'. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d368bd34b5
commit
f0d5ba2128
1 changed files with 3 additions and 0 deletions
|
|
@ -112,6 +112,7 @@ window.__PUBLIC_GLITCHTIP_DSN__ = ${JSON.stringify(PUBLIC_GLITCHTIP_DSN)};
|
|||
},
|
||||
});
|
||||
|
||||
const isDev = process.env.NODE_ENV !== 'production';
|
||||
setSecurityHeaders(response, {
|
||||
connectSrc: [
|
||||
PUBLIC_MANA_CORE_AUTH_URL_CLIENT,
|
||||
|
|
@ -130,6 +131,8 @@ window.__PUBLIC_GLITCHTIP_DSN__ = ${JSON.stringify(PUBLIC_GLITCHTIP_DSN)};
|
|||
PUBLIC_MANA_MEDIA_URL_CLIENT,
|
||||
PUBLIC_MANA_LLM_URL_CLIENT,
|
||||
'wss://sync.mana.how',
|
||||
// Allow all localhost ports in development
|
||||
...(isDev ? ['http://localhost:*', 'ws://localhost:*'] : []),
|
||||
].filter(Boolean),
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue