diff --git a/src/main.ts b/src/main.ts index 849eca2..10516c1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,22 +19,49 @@ async function bootstrap() { app.enableCors({ credentials: true, origin: ['http://localhost:3000'], - methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS', + methods: ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE', 'OPTIONS'], allowedHeaders: [ + 'content-type', 'Content-Type', + 'oa-token', 'OA-TOKEN', + 'content-length', 'Content-Length', + 'x-requested-with', 'X-Requested-With', + 'accept', 'Accept', + 'accept-encoding', 'Accept-Encoding', + 'accept-language', 'Accept-Language', + 'accept-headers', 'Accept-Headers', + 'user-agent', 'User-Agent', + 'host', 'Host', + 'connection', 'Connection', + 'authorization', 'Authorization', ], - exposedHeaders: ['Authorization', 'OA-TOKEN', 'Location'], + exposedHeaders: [ + 'Authorization', + 'authorization', + 'OA-TOKEN', + 'oa-token', + 'Location', + 'location', + 'access-control-allow-origin', + 'Access-Control-Allow-Origin', + 'access-control-allow-headers', + 'Access-Control-Allow-Headers', + 'access-control-allow-methods', + 'Access-Control-Allow-Methods', + 'access-control-allow-credentials', + 'Access-Control-Allow-Credentials', + ], }); const port = Number(process.env.PORT); diff --git a/src/presentation/tip/tip.controller.ts b/src/presentation/tip/tip.controller.ts index a4c65af..c3f78cb 100644 --- a/src/presentation/tip/tip.controller.ts +++ b/src/presentation/tip/tip.controller.ts @@ -96,7 +96,7 @@ export class TipController { .sendStatus(200); } - @Get('/search?') + @Get('/search') async searchTip( @Headers('Authorization') token: string, @Query() dto: SearchTipRequest,