mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 07:43:17 +00:00
reverseproxy: Minor lint fixes
This commit is contained in:
parent
deedf8abb0
commit
132525de3b
2 changed files with 15 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue