mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Added content security policy.
This commit is contained in:
parent
2b7da339e2
commit
adb069babc
2 changed files with 36 additions and 9 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue