File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -95,16 +95,22 @@ pub fn token(token: String) -> Token {
95
95
pub struct SecurityHeadersMiddleware ;
96
96
97
97
impl Middleware for SecurityHeadersMiddleware {
98
- fn after ( & self , _: & mut Request , mut res : Result < Response , Box < Error +Send > > )
99
- -> Result < Response , Box < Error +Send > > {
98
+ fn after (
99
+ & self ,
100
+ _: & mut Request ,
101
+ mut res : Result < Response , Box < Error + Send > > ,
102
+ ) -> Result < Response , Box < Error + Send > > {
100
103
if let Ok ( ref mut response) = res {
101
104
response. headers . insert (
102
105
"Content-Security-Policy" . into ( ) ,
103
- vec ! [ "default-src 'self'; \
106
+ vec ! [
107
+ "default-src 'self'; \
104
108
script-src 'self' https://www.google-analytics.com https://www.google.com; \
105
109
style-src 'self' https://www.google.com; \
106
110
img-src *; \
107
- object-src 'none'". into( ) ] ,
111
+ object-src 'none'"
112
+ . into( ) ,
113
+ ] ,
108
114
) ;
109
115
response. headers . insert (
110
116
"X-Content-Type-Options" . into ( ) ,
You can’t perform that action at this time.
0 commit comments