From 3a04349fac242bc0b118c64627eb950952b9483c Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Wed, 18 Dec 2024 08:47:49 -0700 Subject: [PATCH] Fixing trailing slash in CORS --- src/api/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/src/index.ts b/src/api/src/index.ts index 095d5d1..0f41967 100644 --- a/src/api/src/index.ts +++ b/src/api/src/index.ts @@ -12,7 +12,7 @@ app.use(express.urlencoded({ extended: true })); // for parsing application/x-ww app.use( helmet.contentSecurityPolicy({ directives: { - "default-src": ["'self'", `${AUTH0_DOMAIN}`], + "default-src": ["'self'", `${AUTH0_DOMAIN.replace(/\/$/, "")}`], "base-uri": ["'self'"], "block-all-mixed-content": [], "font-src": ["'self'", "https:", "data:"], @@ -23,7 +23,7 @@ app.use( "script-src-attr": ["'none'"], "style-src": ["'self'", "https:", "'unsafe-inline'"], "worker-src": ["'self'", "blob:"], - "connect-src": ["'self'", `${AUTH0_DOMAIN}`], + "connect-src": ["'self'", `${AUTH0_DOMAIN.replace(/\/$/, "")}`], }, }) );