@@ -62,7 +62,7 @@ pub fn default(mut headers: impl AsMut<Headers>) {
62
62
// /// ```
63
63
#[ inline]
64
64
pub fn dns_prefetch_control ( mut headers : impl AsMut < Headers > ) {
65
- headers. as_mut ( ) . insert ( "X-DNS-Prefetch-Control " , "on" ) ;
65
+ headers. as_mut ( ) . insert ( "x-dns-prefetch-control " , "on" ) ;
66
66
}
67
67
68
68
/// Set the frameguard level.
@@ -92,7 +92,7 @@ pub fn frameguard(mut headers: impl AsMut<Headers>, guard: Option<FrameOptions>)
92
92
None | Some ( FrameOptions :: SameOrigin ) => "sameorigin" ,
93
93
Some ( FrameOptions :: Deny ) => "deny" ,
94
94
} ;
95
- headers. as_mut ( ) . insert ( "X-Frame-Options " , kind) ;
95
+ headers. as_mut ( ) . insert ( "x-frame-options " , kind) ;
96
96
}
97
97
98
98
/// Removes the `X-Powered-By` header to make it slightly harder for attackers to see what
@@ -111,7 +111,7 @@ pub fn frameguard(mut headers: impl AsMut<Headers>, guard: Option<FrameOptions>)
111
111
// /// ```
112
112
#[ inline]
113
113
pub fn powered_by ( mut headers : impl AsMut < Headers > , value : Option < HeaderValue > ) {
114
- let name = HeaderName :: from_lowercase_str ( "X-Powered-By " ) ;
114
+ let name = HeaderName :: from_lowercase_str ( "x-powered-by " ) ;
115
115
match value {
116
116
Some ( value) => {
117
117
headers. as_mut ( ) . insert ( name, value) ;
@@ -141,7 +141,7 @@ pub fn powered_by(mut headers: impl AsMut<Headers>, value: Option<HeaderValue>)
141
141
pub fn hsts ( mut headers : impl AsMut < Headers > ) {
142
142
headers
143
143
. as_mut ( )
144
- . insert ( "Strict-Transport-Security " , "max-age=5184000" ) ;
144
+ . insert ( "strict-transport-security " , "max-age=5184000" ) ;
145
145
}
146
146
147
147
/// Prevent browsers from trying to guess (“sniff”) the MIME type, which can have security
@@ -159,7 +159,7 @@ pub fn hsts(mut headers: impl AsMut<Headers>) {
159
159
// /// ```
160
160
#[ inline]
161
161
pub fn nosniff ( mut headers : impl AsMut < Headers > ) {
162
- headers. as_mut ( ) . insert ( "X-Content-Type-Options " , "nosniff" ) ;
162
+ headers. as_mut ( ) . insert ( "x-content-type-options " , "nosniff" ) ;
163
163
}
164
164
165
165
/// Sets the `X-XSS-Protection` header to prevent reflected XSS attacks.
@@ -176,7 +176,7 @@ pub fn nosniff(mut headers: impl AsMut<Headers>) {
176
176
// /// ```
177
177
#[ inline]
178
178
pub fn xss_filter ( mut headers : impl AsMut < Headers > ) {
179
- headers. as_mut ( ) . insert ( "X-XSS-Protection " , "1; mode=block" ) ;
179
+ headers. as_mut ( ) . insert ( "x-xss-protection " , "1; mode=block" ) ;
180
180
}
181
181
182
182
/// Set the Referrer-Policy level
@@ -232,5 +232,5 @@ pub fn referrer_policy(mut headers: impl AsMut<Headers>, referrer: Option<Referr
232
232
233
233
// We MUST allow for multiple Referrer-Policy headers to be set.
234
234
// See: https://w3c.github.io/webappsec-referrer-policy/#unknown-policy-values example #13
235
- headers. as_mut ( ) . append ( "Referrer-Policy " , policy) ;
235
+ headers. as_mut ( ) . append ( "referrer-policy " , policy) ;
236
236
}
0 commit comments