Skip to content

Commit 91ca5a4

Browse files
Merge pull request #16888 from pecameron/bz1501133
Automatic merge from submit-queue (batch tested with PRs 16888, 16911, 16913, 16904). Router - hsts for "edge" or "reencrypt" only Suppress Strict-Transport-Security header for http requests It is only emitted for https. bug 1501133 https://bugzilla.redhat.com/show_bug.cgi?id=1501133 see comment #3
2 parents fd08639 + c8a9af0 commit 91ca5a4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

images/router/haproxy/conf/haproxy-config.template

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,11 @@ backend be_secure:{{$cfgIdx}}
390390
{{- end }}
391391
{{- end }}{{/* end disable cookies check */}}
392392

393-
{{- with $hsts := firstMatch $hstsPattern (index $cfg.Annotations "haproxy.router.openshift.io/hsts_header") }}
393+
{{- if matchValues (print $cfg.TLSTermination) "edge" "reencrypt" }}
394+
{{- with $hsts := firstMatch $hstsPattern (index $cfg.Annotations "haproxy.router.openshift.io/hsts_header") }}
394395
http-response set-header Strict-Transport-Security {{$hsts}}
395-
{{- end }}{{/* hsts header */}}
396+
{{- end }}{{/* hsts header */}}
397+
{{- end }}{{/* is "edge" or "reencrypt" */}}
396398

397399
{{- range $serviceUnitName, $weight := $cfg.ServiceUnitNames }}
398400
{{- if ne $weight 0 }}

0 commit comments

Comments
 (0)