Fix forced HSTS logic in 'SpaceHelmet'.

This commit is contained in:
jeb 2018-11-17 21:55:29 -08:00 committed by Sergio Benitez
parent 59e27820e9
commit af84f60bb8
1 changed files with 4 additions and 2 deletions

View File

@ -180,8 +180,10 @@ impl SpaceHelmet {
response.set_header(policy.header());
}
if !self.force_hsts.load(Ordering::Relaxed) {
response.set_header(Policy::header(&Hsts::default()));
if self.force_hsts.load(Ordering::Relaxed) {
if !response.headers().contains(Hsts::NAME) {
response.set_header(&Hsts::default());
}
}
}
}