Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use field converter to remove port from hdr host #729

Merged
merged 1 commit into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/haproxy/instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3406,7 +3406,7 @@ func (c *testConfig) checkConfigFile(expected, fileName string) {
mode http
http-request use-service lua.send-404`,
" <<set-req-base>>": ` http-request set-var(req.path) path
http-request set-var(req.host) hdr(host),regsub(:[0-9]+$,),lower
http-request set-var(req.host) hdr(host),field(1,:),lower
http-request set-var(req.base) var(req.host),concat(,req.path)`,
" <<http-headers>>": ` http-request set-header X-Forwarded-Proto http
http-request del-header X-SSL-Client-CN
Expand Down Expand Up @@ -3445,7 +3445,7 @@ func (c *testConfig) checkConfigFile(expected, fileName string) {
mode http
bind :443 ssl alpn h2,http/1.1 crt-list /etc/haproxy/maps/_front_bind_crt.list ca-ignore-err all crt-ignore-err all
http-request set-var(req.path) path
http-request set-var(req.host) hdr(host),regsub(:[0-9]+$,),lower
http-request set-var(req.host) hdr(host),field(1,:),lower
http-request set-var(req.base) var(req.host),concat(,req.path)
http-request set-var(req.hostbackend) var(req.base),lower,map_beg(/etc/haproxy/maps/_front_https_host__begin.map)
<<https-headers>>
Expand Down
4 changes: 2 additions & 2 deletions rootfs/etc/templates/haproxy/haproxy.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ frontend _front_http

{{- /*------------------------------------*/}}
http-request set-var(req.path) path
http-request set-var(req.host) hdr(host),regsub(:[0-9]+$,),lower
http-request set-var(req.host) hdr(host),field(1,:),lower
http-request set-var(req.base) var(req.host),concat(,req.path)

{{- /*------------------------------------*/}}
Expand Down Expand Up @@ -997,7 +997,7 @@ frontend _front_https
{{- /*------------------------------------*/}}
{{- if or $fmaps.RedirFromRootMap.HasHost $fmaps.HTTPSHostMap.HasHost $fmaps.HTTPSSNIMap.HasHost $fmaps.TLSAuthList.HasHost $fmaps.TLSNeedCrtList.MatchTypes $fmaps.VarNamespaceMap.HasHost }}
http-request set-var(req.path) path
http-request set-var(req.host) hdr(host),regsub(:[0-9]+$,),lower
http-request set-var(req.host) hdr(host),field(1,:),lower
http-request set-var(req.base) var(req.host),concat(,req.path)
{{- end }}

Expand Down