Rocket

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit af84f60bb8c82c48ad38bbc9dd681449eee1ff16
parent 59e27820e92d2b36c63ca9c2111b6eaed0009a24
Author: jeb <jeb@jebrosen.com>
Date:   Sat, 17 Nov 2018 21:55:29 -0800

Fix forced HSTS logic in 'SpaceHelmet'.

Diffstat:
Mcontrib/lib/src/helmet/helmet.rs | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/contrib/lib/src/helmet/helmet.rs b/contrib/lib/src/helmet/helmet.rs @@ -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()); + } } } }