Added content security policy.

This commit is contained in:
Mike Cao 2022-07-31 23:29:47 -07:00
parent 2b7da339e2
commit adb069babc
2 changed files with 36 additions and 9 deletions

View file

@ -33,14 +33,6 @@ function customScriptName(req) {
}
}
function forceSSL(req, res) {
if (process.env.FORCE_SSL && req.nextUrl.protocol === 'http:') {
res.headers.set('Strict-Transport-Security', 'max-age=31536000; includeSubDomains');
}
return res;
}
export default function middleware(req) {
const fns = [customCollectEndpoint, customScriptName];
@ -51,5 +43,5 @@ export default function middleware(req) {
}
}
return forceSSL(req, NextResponse.next());
return NextResponse.next();
}