mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
Implementing CORS and CSP headers from env config
This commit is contained in:
@@ -18,3 +18,14 @@ export function sanitizeMiddleware(req: Request, res: Response, next: NextFuncti
|
||||
}
|
||||
next()
|
||||
}
|
||||
|
||||
export function getAllowedCorsOrigins(): string {
|
||||
// Expects FQDN separated by commas, otherwise nothing or * for all.
|
||||
return process.env.CORS_ORIGINS ?? '*'
|
||||
}
|
||||
|
||||
export function getAllowedEmbeddingOrigins(): string {
|
||||
// Expects FQDN separated by commas, otherwise nothing or * for all.
|
||||
// Also CSP allowed values: self or none
|
||||
return process.env.EMBEDDING_ORIGINS ?? '*'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user