enforce ^~ location modifier when rewrite-target annotation is set
This commit is contained in:
parent
aff61dc2dc
commit
0e6f0bb88d
3 changed files with 37 additions and 5 deletions
|
|
@ -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 }}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue