enforce ^~ location modifier when rewrite-target annotation is set

This commit is contained in:
Zenara Daley 2018-09-13 10:39:52 -04:00
parent aff61dc2dc
commit 0e6f0bb88d
3 changed files with 37 additions and 5 deletions

View file

@ -452,8 +452,9 @@ http {
{{/* build the maps that will be use to validate the Whitelist */}}
{{ range $server := $servers }}
{{ $usesRewrite := atLeastOneNeedsRewrite $server.Locations }}
{{ range $location := $server.Locations }}
{{ $path := buildLocation $location }}
{{ $path := buildLocation $location $usesRewrite }}
{{ if isLocationAllowed $location }}
{{ if gt (len $location.Whitelist.CIDR) 0 }}
@ -818,8 +819,9 @@ stream {
{{ $server.ServerSnippet }}
{{ end }}
{{ $usesRewrite := atLeastOneNeedsRewrite $server.Locations }}
{{ range $location := $server.Locations }}
{{ $path := buildLocation $location }}
{{ $path := buildLocation $location $usesRewrite }}
{{ $proxySetHeader := proxySetHeader $location }}
{{ $authPath := buildAuthLocation $location }}