[][src]Function armor::hsts

pub fn hsts(headers: &mut HeaderMap)

Sets the Strict-Transport-Security header to keep your users on HTTPS.

Note that the header won’t tell users on HTTP to switch to HTTPS, it will tell HTTPS users to stick around. Defaults to 60 days.

read more

Examples

let mut headers = http::HeaderMap::new();
armor::hsts(&mut headers);
assert_eq!(headers["Strict-Transport-Security"], "max-age=5184000");