Skip to content

Commit

Permalink
update: disable csp
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepinkman9900 committed Apr 19, 2024
1 parent 8fd7475 commit 0098c99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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 || '');

Expand Down

0 comments on commit 0098c99

Please sign in to comment.