Skip to content

Commit

Permalink
Merge pull request #16888 from pecameron/bz1501133
Browse files Browse the repository at this point in the history
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
  • Loading branch information
openshift-merge-robot authored Oct 18, 2017
2 parents fd08639 + c8a9af0 commit 91ca5a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions images/router/haproxy/conf/haproxy-config.template
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,11 @@ backend be_secure:{{$cfgIdx}}
{{- end }}
{{- end }}{{/* end disable cookies check */}}

{{- with $hsts := firstMatch $hstsPattern (index $cfg.Annotations "haproxy.router.openshift.io/hsts_header") }}
{{- 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 }}{{/* hsts header */}}
{{- end }}{{/* is "edge" or "reencrypt" */}}

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

0 comments on commit 91ca5a4

Please sign in to comment.