add cf headers for cms draft mode (#38822)

* add cf headers for cms draft mode

* add env vars to turbo.json allowlist
This commit is contained in:
Francesco Sansalvadore
2025-09-18 16:57:32 +02:00
committed by GitHub
parent d70600c029
commit 5c9605e09c
2 changed files with 4 additions and 1 deletions

View File

@@ -6,10 +6,11 @@ import { generateReadingTime } from '~/lib/helpers'
// Lightweight runtime for better performance
export const runtime = 'edge'
// CORS headers for cross-origin requests
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
'CF-Access-Client-Id': process.env.CF_ACCESS_CLIENT_ID ?? '',
'CF-Access-Client-Secret': process.env.CF_ACCESS_CLIENT_SECRET ?? '',
}
// Lightweight TOC generation for edge runtime

View File

@@ -114,6 +114,8 @@
"dependsOn": ["^build"],
"env": [
"ANALYZE",
"CF_ACCESS_CLIENT_ID",
"CF_ACCESS_CLIENT_SECRET",
"CMS_API_KEY",
"CMS_PREVIEW_SECRET",
"CMS_SITE_ORIGIN",