Skip to content

Commit

Permalink
Fixes cloudfront distribution pulling allowed methods from the same l…
Browse files Browse the repository at this point in the history
…ister rule condition as the path

the correct behavior is to pull from the same rule since you can only have one condition type per condition.
  • Loading branch information
DavidSeptimus-Klotho committed Mar 5, 2024
1 parent 805a2a1 commit 104a9bb
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@ operational_rules:
{{ end }}
{{ range $i, $route := $routes }}
{{ $methods := makeSlice }}
{{ range $i, $rule := $rules }}
{{ range $j, $condition := (fieldValue "Conditions" $rule) }}
{{- if (sliceContains $condition.PathPattern.Values $route) }}
{{ range $j, $method := $condition.HttpRequestMethod.Values }}
{{ $methods = appendSlice $methods $method }}
{{- end }}
{{ range $j, $rule := $rules }}
{{ range $k, $condition := (fieldValue "Conditions" $rule) }}
{{ range $l, $method := $condition.HttpRequestMethod.Values }}
{{ $methods = appendSlice $methods $method }}
{{- end }}
{{- end }}
{{ end }}
Expand Down

0 comments on commit 104a9bb

Please sign in to comment.