From 132525de3bfd6acb16f8628fa057cb03e102a177 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 14 Dec 2020 15:30:55 -0700 Subject: reverseproxy: Minor lint fixes --- modules/caddyhttp/reverseproxy/selectionpolicies.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'modules/caddyhttp/reverseproxy/selectionpolicies.go') diff --git a/modules/caddyhttp/reverseproxy/selectionpolicies.go b/modules/caddyhttp/reverseproxy/selectionpolicies.go index a391b2f..e86e97e 100644 --- a/modules/caddyhttp/reverseproxy/selectionpolicies.go +++ b/modules/caddyhttp/reverseproxy/selectionpolicies.go @@ -401,17 +401,16 @@ func (s CookieHashSelection) Select(pool UpstreamPool, req *http.Request, w http // If there's no cookie, select new random host if err != nil || cookie == nil { return selectNewHostWithCookieHashSelection(pool, w, s.Secret, s.Name) - } else { - // If the cookie is present, loop over the available upstreams until we find a match - cookieValue := cookie.Value - for _, upstream := range pool { - if !upstream.Available() { - continue - } - sha, err := hashCookie(s.Secret, upstream.Dial) - if err == nil && sha == cookieValue { - return upstream - } + } + // If the cookie is present, loop over the available upstreams until we find a match + cookieValue := cookie.Value + for _, upstream := range pool { + if !upstream.Available() { + continue + } + sha, err := hashCookie(s.Secret, upstream.Dial) + if err == nil && sha == cookieValue { + return upstream } } // If there is no matching host, select new random host -- cgit v1.2.3