mirror of
https://github.com/movie-web/backend.git
synced 2025-09-13 18:13:26 +00:00
allow any domain config setting
This commit is contained in:
@@ -56,8 +56,10 @@ export async function setupFastify(): Promise<FastifyInstance> {
|
||||
|
||||
// plugins
|
||||
log.info(`setting up plugins`, { evt: 'setup-plugins' });
|
||||
const corsDomains = conf.server.cors.split(' ').filter((v) => v.length > 0);
|
||||
const corsSetting = conf.server.allowAnySite ? true : corsDomains;
|
||||
await app.register(cors, {
|
||||
origin: conf.server.cors.split(' ').filter((v) => v.length > 0),
|
||||
origin: corsSetting,
|
||||
credentials: true,
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user