From 9eec5e66b9285a76b12646a9cf0ad3a361399f70 Mon Sep 17 00:00:00 2001 From: martmull Date: Thu, 16 May 2024 14:41:03 +0200 Subject: [PATCH 1/2] Fix Apply Cors exception handler --- packages/twenty-server/src/utils/apply-cors-to-exceptions.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/twenty-server/src/utils/apply-cors-to-exceptions.ts b/packages/twenty-server/src/utils/apply-cors-to-exceptions.ts index 24910c9f4422..1b17fd2ab1c5 100644 --- a/packages/twenty-server/src/utils/apply-cors-to-exceptions.ts +++ b/packages/twenty-server/src/utils/apply-cors-to-exceptions.ts @@ -11,6 +11,10 @@ export class ApplyCorsToExceptions implements ExceptionFilter { const ctx = host.switchToHttp(); const response = ctx.getResponse(); + if (!response.header) { + return; + } + response.header('Access-Control-Allow-Origin', '*'); response.header( 'Access-Control-Allow-Methods', From 6a17c4d816d5de765f5fe728aafbed6e3888684a Mon Sep 17 00:00:00 2001 From: martmull Date: Thu, 16 May 2024 14:42:09 +0200 Subject: [PATCH 2/2] Fix lint --- packages/twenty-front/project.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/twenty-front/project.json b/packages/twenty-front/project.json index c85c18c52dd3..b5673df9fe28 100644 --- a/packages/twenty-front/project.json +++ b/packages/twenty-front/project.json @@ -82,7 +82,7 @@ "STORYBOOK_SCOPE": "pages" } }, - "performance": { + "performance": { "env": { "NODE_OPTIONS": "--max_old_space_size=5000", "STORYBOOK_SCOPE": "performance" @@ -124,7 +124,6 @@ "modules": { "env": { "STORYBOOK_SCOPE": "modules" } }, "pages": { "env": { "STORYBOOK_SCOPE": "pages" } }, "performance": { "env": { "STORYBOOK_SCOPE": "performance" } } - } }, "storybook:test:nocoverage": { @@ -133,7 +132,6 @@ "modules": { "env": { "STORYBOOK_SCOPE": "modules" } }, "pages": { "env": { "STORYBOOK_SCOPE": "pages" } }, "performance": { "env": { "STORYBOOK_SCOPE": "performance" } } - } }, "storybook:static:test": {