Skip to content

Commit

Permalink
Fix case on requests from 80/http
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmoraisjr committed Oct 26, 2019
1 parent e808976 commit 3d265b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pkg/haproxy/instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ backend d1_app_8080
frontend _front_http
mode http
` + test.expectedHTTP + `
http-request set-var(req.base) base,regsub(:[0-9]+/,/)
http-request set-var(req.base) base,lower,regsub(:[0-9]+/,/)
http-request redirect scheme https if { var(req.base),map_beg(/etc/haproxy/maps/_global_https_redir.map,_nomatch) yes }
<<http-headers>>
http-request set-var(req.backend) var(req.base),map_beg(/etc/haproxy/maps/_global_http_front.map,_nomatch)
Expand Down Expand Up @@ -1476,7 +1476,7 @@ backend d1_app_8080
frontend _front_http
mode http
bind :80
http-request set-var(req.base) base,regsub(:[0-9]+/,/)
http-request set-var(req.base) base,lower,regsub(:[0-9]+/,/)
http-request redirect scheme https if { var(req.base),map_beg(/etc/haproxy/maps/_global_https_redir.map,_nomatch) yes }
<<http-headers>>
http-request set-var(req.backend) var(req.base),map_beg(/etc/haproxy/maps/_global_http_front.map,_nomatch)
Expand Down Expand Up @@ -1614,7 +1614,7 @@ backend d2_app_8080
frontend _front_http
mode http
bind :80
http-request set-var(req.base) base,regsub(:[0-9]+/,/)
http-request set-var(req.base) base,lower,regsub(:[0-9]+/,/)
http-request redirect scheme https if { var(req.base),map_beg(/etc/haproxy/maps/_global_https_redir.map,_nomatch) yes }
http-request set-var(req.host) hdr(host),lower,regsub(:[0-9]+/,/)
http-request set-var(req.rootredir) var(req.host),map(/etc/haproxy/maps/_global_http_root_redir.map,_nomatch)
Expand Down Expand Up @@ -2239,7 +2239,7 @@ listen _front__tls
frontend _front_http
mode http
bind :80
http-request set-var(req.base) base,regsub(:[0-9]+/,/)
http-request set-var(req.base) base,lower,regsub(:[0-9]+/,/)
http-request set-var(req.redir) var(req.base),map_beg(/etc/haproxy/maps/_global_https_redir.map,_nomatch)
http-request redirect scheme https if { var(req.redir) yes }
http-request redirect scheme https if { var(req.redir) _nomatch } { var(req.base),map_reg(/etc/haproxy/maps/_global_https_redir_regex.map,_nomatch) yes }
Expand Down Expand Up @@ -2609,7 +2609,7 @@ backend _error496
"<<frontend-http>>": `frontend _front_http
mode http
bind :80
http-request set-var(req.base) base,regsub(:[0-9]+/,/)
http-request set-var(req.base) base,lower,regsub(:[0-9]+/,/)
http-request redirect scheme https if { var(req.base),map_beg(/etc/haproxy/maps/_global_https_redir.map,_nomatch) yes }
<<http-headers>>
http-request set-var(req.backend) var(req.base),map_beg(/etc/haproxy/maps/_global_http_front.map,_nomatch)
Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/haproxy/template/haproxy.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ frontend _front_http
{{- end }}

{{- /*------------------------------------*/}}
http-request set-var(req.base) base,regsub(:[0-9]+/,/)
http-request set-var(req.base) base,lower,regsub(:[0-9]+/,/)

{{- /*------------------------------------*/}}
{{- if $fgroup.HTTPSRedirMap.HasRegex }}
Expand Down

0 comments on commit 3d265b2

Please sign in to comment.