Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cloudflare-worker/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@ function getCorsHeaders(request) {
};
}

// Allow Cloudflare Pages staging preview URLs (*.staging-cambeerfestival.pages.dev)
// This includes branch-based staging deployments
// Security note: Same as above - Cloudflare controls the .pages.dev namespace
if (origin.endsWith('.staging-cambeerfestival.pages.dev')) {
return {
'Access-Control-Allow-Origin': origin,
'Access-Control-Allow-Credentials': 'true',
};
}

// Reject all other origins by not including CORS headers
return {};
}
Expand Down