diff --git a/pkg/ingress/ingress.go b/pkg/ingress/ingress.go index 4ebd363..e855295 100644 --- a/pkg/ingress/ingress.go +++ b/pkg/ingress/ingress.go @@ -60,24 +60,15 @@ func (i *Ingresses) Strings() []string { } func (i *Ingresses) MatchingIngress(r *http.Request) (Ingress, bool) { - var match Ingress - found := false - for _, ingress := range i.ingressMap { hostMatch := ingress.Host() == r.Host || ingress.Host() == r.Header.Get(XForwardedHost) pathMatch := ingress.Path() == i.MatchingPath(r) if hostMatch && pathMatch { - match = ingress - found = true - break + return ingress, true } } - if found { - return match, true - } - return Ingress{}, false }