mirror of
https://github.com/vacp2p/linea-monorepo.git
synced 2026-01-06 22:23:55 -05:00
Fix: update csp headers in bridge ui (#1187)
* fix: update csp headers in bridge ui * fix: update csp headers in bridge ui
This commit is contained in:
@@ -7,7 +7,7 @@ export function middleware(request: NextRequest) {
|
||||
// We only want to allow unsafe-eval in local environment for NextJS dev server
|
||||
// We are required to use unsafe-inline with Cloudflare - https://developers.cloudflare.com/fundamentals/reference/policies-compliances/content-security-policies/#product-requirements
|
||||
// TODO: Remove unsafe-eval in production and replace with 'unsafe-inline'
|
||||
const unsafeScript = process.env.NEXT_PUBLIC_ENVIRONMENT === "local" ? "'unsafe-eval'" : "'unsafe-eval'";
|
||||
// const unsafeScript = process.env.NEXT_PUBLIC_ENVIRONMENT === "local" ? "'unsafe-eval'" : "'unsafe-eval'";
|
||||
|
||||
/**
|
||||
* Content Security Policy (CSP) configuration:
|
||||
@@ -54,8 +54,7 @@ export function middleware(request: NextRequest) {
|
||||
*/
|
||||
const cspHeader = `
|
||||
default-src 'self';
|
||||
script-src 'self' 'nonce-${nonce}' ${unsafeScript} https://bridge.linea.build https://bridge-devnet.linea.build
|
||||
https://www.googletagmanager.com/gtm.js https://widget.intercom.io/widget/h5zisg78;
|
||||
script-src 'self' 'nonce-${nonce}' https://www.googletagmanager.com/gtm.js https://widget.intercom.io/widget/h5zisg78 https://ajax.cloudflare.com https://js.intercomcdn.com;
|
||||
style-src 'self' 'unsafe-inline';
|
||||
img-src 'self' blob: data: https:;
|
||||
font-src 'self' data: https://cdn.jsdelivr.net;
|
||||
|
||||
Reference in New Issue
Block a user