Browse Source

reverseproxy: Set cookie path to `/` when using cookie lb_policy (#4096)

master
Dimitri Masson 4 years ago
committed by GitHub
parent
commit
bd357bf005
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      modules/caddyhttp/reverseproxy/selectionpolicies.go

2
modules/caddyhttp/reverseproxy/selectionpolicies.go

@ -445,7 +445,7 @@ func selectNewHostWithCookieHashSelection(pool []*Upstream, w http.ResponseWrite
sha, err := hashCookie(cookieSecret, randomHost.Dial) sha, err := hashCookie(cookieSecret, randomHost.Dial)
if err == nil { if err == nil {
// write the cookie. // write the cookie.
http.SetCookie(w, &http.Cookie{Name: cookieName, Value: sha, Secure: false}) http.SetCookie(w, &http.Cookie{Name: cookieName, Value: sha, Path: "/", Secure: false})
} }
} }
return randomHost return randomHost

Loading…
Cancel
Save