diff --git a/src/middleware/cors-middleware.ts b/src/middleware/cors-middleware.ts index bc9242a..72f3d01 100644 --- a/src/middleware/cors-middleware.ts +++ b/src/middleware/cors-middleware.ts @@ -2,10 +2,9 @@ import cors from "cors"; // Allow CORS for Netlify deploy previews const allowedOrigins = ["https://reflectionsprojections.org"]; - // Function to check if the origin matches the deploy preview format function isNetlifyDeployPreview(origin: string) { - const regex = /^https:\/\/deploy-preview-\d+--rp2024\.netlify\.app\/$/; + const regex = new RegExp("deploy-preview-[0-9]*(--rp2024.netlify.app)(.*)"); return regex.test(origin); }