bolt_web/middleware/
helmet.rs

1use crate::{
2    bolt_middleware,
3    {request::RequestBody, response::ResponseWriter},
4};
5
6pub async fn helmet(_req: &mut RequestBody, res: &mut ResponseWriter) {
7    res.set_header("X-DNS-Prefetch-Control", "off");
8    res.set_header("X-Frame-Options", "SAMEORIGIN");
9    res.set_header("X-Content-Type-Options", "nosniff");
10    res.set_header("Referrer-Policy", "no-referrer");
11    res.set_header("Permissions-Policy", "geolocation=(), microphone=()");
12}
13
14bolt_middleware!(helmet);