File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { env , getEnv } from '../env'
1+ import { env , getEnv } from '@/lib/env'
2+ import { getBaseUrl } from '@/lib/urls/utils'
23
34/**
45 * Content Security Policy (CSP) configuration builder
@@ -76,7 +77,7 @@ export const buildTimeCSPDirectives: CSPDirectives = {
7677
7778 'connect-src' : [
7879 "'self'" ,
79- env . NEXT_PUBLIC_APP_URL || '' ,
80+ getBaseUrl ( ) ,
8081 env . OLLAMA_URL || 'http://localhost:11434' ,
8182 env . NEXT_PUBLIC_SOCKET_URL || 'http://localhost:3002' ,
8283 env . NEXT_PUBLIC_SOCKET_URL ?. replace ( 'http://' , 'ws://' ) . replace ( 'https://' , 'wss://' ) ||
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { Server } from 'socket.io'
33import { env } from '@/lib/env'
44import { isProd } from '@/lib/environment'
55import { createLogger } from '@/lib/logs/console/logger'
6+ import { getBaseUrl } from '@/lib/urls/utils'
67
78const logger = createLogger ( 'SocketIOConfig' )
89
@@ -11,7 +12,7 @@ const logger = createLogger('SocketIOConfig')
1112 */
1213function getAllowedOrigins ( ) : string [ ] {
1314 const allowedOrigins = [
14- env . NEXT_PUBLIC_APP_URL ,
15+ getBaseUrl ( ) ,
1516 'http://localhost:3000' ,
1617 'http://localhost:3001' ,
1718 ...( env . ALLOWED_ORIGINS ?. split ( ',' ) || [ ] ) ,
You can’t perform that action at this time.
0 commit comments