From 1ceab68b4279a87583b4a36b964dcd7664ca31cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=8E=E8=97=A4=E3=80=80=E5=BF=AB=E6=96=97?= Date: Wed, 17 May 2023 10:40:43 +0900 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E5=AE=9A=E3=81=AE=E3=82=AA=E3=83=AA?= =?UTF-8?q?=E3=82=B8=E3=83=B3=E3=81=8B=E3=82=89=E3=81=AE=E3=83=AA=E3=82=AF?= =?UTF-8?q?=E3=82=A8=E3=82=B9=E3=83=88=E3=82=92=E8=A8=B1=E5=8F=AF=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dictation_server/src/main.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dictation_server/src/main.ts b/dictation_server/src/main.ts index 04ae4b3..1f19992 100644 --- a/dictation_server/src/main.ts +++ b/dictation_server/src/main.ts @@ -14,8 +14,12 @@ helmetDirectives['navigate-to'] = ["'self'"]; helmetDirectives['style-src'] = ["'self'", 'https:']; helmetDirectives['report-uri'] = ["'self'"]; async function bootstrap() { - const app = await NestFactory.create(AppModule, { - cors: process.env.CORS === 'TRUE', + const app = await NestFactory.create(AppModule); + //XXX 特定のオリジンからのリクエストは許可する + app.enableCors({ + origin: 'http://localhost:8180', + methods: 'GET,PUT,POST,DELETE', + allowedHeaders: 'Content-Type', }); app.use( helmet({