pub use axum_helmet::{
ContentSecurityPolicy, ContentSecurityPolicyDirective,
CrossOriginEmbedderPolicy, CrossOriginOpenerPolicy, CrossOriginResourcePolicy,
Header, HelmetLayer, OriginAgentCluster, ReferrerPolicy,
StrictTransportSecurity, XContentTypeOptions, XDNSPrefetchControl,
XDownloadOptions, XFrameOptions, XPermittedCrossDomainPolicies, XPoweredBy,
XXSSProtection,
};
pub struct Helmet {
headers: Vec<Header>,
}
impl Helmet {
pub const fn builder() -> Self {
Self {
headers: Vec::new(),
}
}
pub fn with_header<H: Into<Header>>(mut self, header: H) -> Self {
self.headers.push(header.into());
self
}
pub fn build(self) -> HelmetLayer {
HelmetLayer::new(axum_helmet::Helmet {
headers: self.headers,
})
}
}