From 0098c99e4ca6c229af84ed443a42ec1ed31c0243 Mon Sep 17 00:00:00 2001 From: jessepinkman9900 Date: Fri, 19 Apr 2024 00:57:02 -0500 Subject: [PATCH] update: disable csp --- middleware.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/middleware.ts b/middleware.ts index 17648c82f8..e785f29b46 100644 --- a/middleware.ts +++ b/middleware.ts @@ -1,10 +1,10 @@ import type { NextRequest } from 'next/server'; import { NextResponse } from 'next/server'; -import generateCspPolicy from 'nextjs/csp/generateCspPolicy'; +// import generateCspPolicy from 'nextjs/csp/generateCspPolicy'; import * as middlewares from 'nextjs/middlewares/index'; -const cspPolicy = generateCspPolicy(); +// const cspPolicy = generateCspPolicy(); export function middleware(req: NextRequest) { const isPageRequest = req.headers.get('accept')?.includes('text/html'); @@ -21,7 +21,7 @@ export function middleware(req: NextRequest) { const end = Date.now(); const res = NextResponse.next(); - res.headers.append('Content-Security-Policy', cspPolicy); + // res.headers.append('Content-Security-Policy', cspPolicy); res.headers.append('Server-Timing', `middleware;dur=${ end - start }`); res.headers.append('Docker-ID', process.env.HOSTNAME || '');