Router - hsts for "edge" or "reencrypt" only
Suppress Strict-Transport-Security header for http requests
It is only emitted for https.
bug
see comment
@@ -390,9 +390,11 @@ backend be_secure:{{$cfgIdx}}
{{- end }}
{{- end }}{{/* end disable cookies check */}}
+ {{- if matchValues (print $cfg.TLSTermination) "edge" "reencrypt" }}
{{- with $hsts := firstMatch $hstsPattern (index $cfg.Annotations "haproxy.router.openshift.io/hsts_header") }}
http-response set-header Strict-Transport-Security {{$hsts}}
{{- end }}{{/* hsts header */}}
+ {{- end }}{{/* is "edge" or "reencrypt" */}}
{{- range $serviceUnitName, $weight := $cfg.ServiceUnitNames }}
{{- if ne $weight 0 }}
