mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Website: Update response headers (#36543)
Closes: https://github.com/fleetdm/confidential/issues/11257 Changes: - Updated the website's custom hook to set security-related response headers for GET and HEAD requests
This commit is contained in:
parent
2521daa1fe
commit
b9b4ba1cc9
1 changed files with 7 additions and 0 deletions
7
website/api/hooks/custom/index.js
vendored
7
website/api/hooks/custom/index.js
vendored
|
|
@ -178,6 +178,13 @@ will be disabled and/or hidden in the UI.
|
|||
throw new Error('Cannot attach view local `me`, because this view local already exists! (Is it being attached somewhere else?)');
|
||||
}
|
||||
res.locals.me = undefined;
|
||||
|
||||
// Set security headers for all GET and HEAD requests.
|
||||
res.setHeader(`X-Content-Type-Options`, `nosniff`);//[?]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Content-Type-Options
|
||||
res.setHeader('X-Frame-Options', 'SAMEORIGIN');// [?]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Frame-Options
|
||||
res.setHeader(`Referrer-Policy`, `strict-origin-when-cross-origin`);// [?]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Referrer-Policy
|
||||
res.setHeader('Strict-Transport-Security', 'max-age=31536000; includeSubDomains;');// [?]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security
|
||||
res.setHeader(`Permissions-Policy`, `camera=(), microphone=(), usb=()`);// [?]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Permissions-Policy
|
||||
}//fi
|
||||
|
||||
// Check for query parameters set by ad clicks.
|
||||
|
|
|
|||
Loading…
Reference in a new issue