Skip to content

Commit

Permalink
Do not render invalid request mirroring config
Browse files Browse the repository at this point in the history
Signed-off-by: Gerald Pape <[email protected]>
  • Loading branch information
ubergesundheit committed May 31, 2023
1 parent 41f6f8c commit 165a411
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/ingress/controller/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -1727,7 +1727,7 @@ func buildMirrorLocations(locs []*ingress.Location) string {
mapped := sets.Set[string]{}

for _, loc := range locs {
if loc.Mirror.Source == "" || loc.Mirror.Target == "" {
if loc.Mirror.Source == "" || loc.Mirror.Target == "" || loc.Mirror.Host == "" {
continue
}

Expand All @@ -1738,8 +1738,8 @@ func buildMirrorLocations(locs []*ingress.Location) string {
mapped.Insert(loc.Mirror.Source)
buffer.WriteString(fmt.Sprintf(`location = %v {
internal;
proxy_set_header Host %v;
proxy_pass %v;
proxy_set_header Host "%v";
proxy_pass "%v";
}
`, loc.Mirror.Source, loc.Mirror.Host, loc.Mirror.Target))
Expand Down

0 comments on commit 165a411

Please sign in to comment.