]> git.openstreetmap.org Git - chef.git/commitdiff
Make sure STS and Expect-CT headers are set on redirect responses
authorTom Hughes <tom@compton.nu>
Thu, 31 May 2018 18:04:06 +0000 (19:04 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 31 May 2018 18:04:06 +0000 (19:04 +0100)
cookbooks/apache/templates/default/ssl.erb

index 6835e8ea54745a2ef22c30b0c28e6e649536f415..ffbbcbb5e7259e0ec5fbb48b8932a867048348ac 100644 (file)
@@ -15,9 +15,6 @@ SSLStaplingErrorCacheTimeout 60
 SSLStaplingReturnResponderErrors off
 SSLStaplingFakeTryLater off
 SSLStaplingCache shmcb:${APACHE_RUN_DIR}/ssl_ocspcache(512000)
-<% if node[:ssl][:strict_transport_security] -%>
 
-Header setifempty Strict-Transport-Security "<%= node[:ssl][:strict_transport_security] %>" env=HTTPS
-<% end -%>
-
-Header setifempty Expect-CT "max-age=0, report-uri=\"https://openstreetmap.report-uri.com/r/d/ct/reportOnly\"" env=HTTPS
+Header always set Strict-Transport-Security "<%= node[:ssl][:strict_transport_security] %>" "expr=%{HTTPS} == 'on'"
+Header always set Expect-CT "max-age=0, report-uri=\"https://openstreetmap.report-uri.com/r/d/ct/reportOnly\"" "expr=%{HTTPS} == 'on'