2 parents 66b8724 + 255dc99 commit 3c34f54Copy full SHA for 3c34f54
1 file changed
cloudflare-worker/worker.js
@@ -226,6 +226,16 @@ function getCorsHeaders(request) {
226
};
227
}
228
229
+ // Allow Cloudflare Pages staging preview URLs (*.staging-cambeerfestival.pages.dev)
230
+ // This includes branch-based staging deployments
231
+ // Security note: Same as above - Cloudflare controls the .pages.dev namespace
232
+ if (origin.endsWith('.staging-cambeerfestival.pages.dev')) {
233
+ return {
234
+ 'Access-Control-Allow-Origin': origin,
235
+ 'Access-Control-Allow-Credentials': 'true',
236
+ };
237
+ }
238
+
239
// Reject all other origins by not including CORS headers
240
return {};
241
0 commit comments