diff --git a/crates/common/src/config/jmap/settings.rs b/crates/common/src/config/jmap/settings.rs index a2ff11f6..0fd80d33 100644 --- a/crates/common/src/config/jmap/settings.rs +++ b/crates/common/src/config/jmap/settings.rs @@ -137,6 +137,16 @@ impl JmapConfig { )); } + // Add HTTP Strict Transport Security + if config.property::("server.http.hsts").unwrap_or(false) { + http_headers.push(( + hyper::header::STRICT_TRANSPORT_SECURITY, + hyper::header::HeaderValue::from_static( + "max-age=31536000; includeSubDomains; preload", + ), + )); + } + let mut jmap = JmapConfig { default_language: Language::from_iso_639( config