File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # 0.5.1
2+ ## Changes
3+ 1 . Revert 0.5.0 ` set_default_hsts ` changes.
4+
15# 0.5.0
26## Breaking changes
371 . ` set_default_hsts ` is removed, now is default.
Original file line number Diff line number Diff line change 11[package ]
22name = " actix-cloud"
3- version = " 0.5.0 "
3+ version = " 0.5.1 "
44edition = " 2021"
55authors = [" MXWXZ <matrixwxz@gmail.com>" ]
66description = " Actix Cloud is an all-in-one web framework based on Actix Web."
Original file line number Diff line number Diff line change @@ -125,12 +125,19 @@ impl Default for SecurityHeader {
125125 x_xss_protection : XXSSProtection :: EnableBlock ,
126126 cross_origin_opener_policy : CrossOriginOpenerPolicy :: SameOrigin ,
127127 content_security_policy : String :: from ( "default-src 'none'; script-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'" ) ,
128- strict_transport_security : Some ( StrictTransportSecurity :: Preload ( 31536000 ) ) ,
128+ strict_transport_security : None ,
129129 }
130130 }
131131}
132132
133133impl SecurityHeader {
134+ /// Set default HSTS to 1 year, includeSubDomains and preload.
135+ ///
136+ /// `max-age=31536000; includeSubDomains; preload`
137+ pub fn set_default_hsts ( & mut self ) {
138+ self . strict_transport_security = Some ( StrictTransportSecurity :: Preload ( 31536000 ) ) ;
139+ }
140+
134141 pub fn build ( self ) -> middleware:: DefaultHeaders {
135142 let mut ret = middleware:: DefaultHeaders :: new ( )
136143 . add ( ( "X-Content-Type-Options" , "nosniff" ) )
You can’t perform that action at this time.
0 commit comments