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