From 905d9f0345dc1b4e11a578e980f14971a3ad7cfe Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Wed, 20 Jun 2018 14:56:13 +0100 Subject: [PATCH] Fix cookie split should account for cookie name --- oauthproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oauthproxy.go b/oauthproxy.go index 46d77302f..b081484e4 100644 --- a/oauthproxy.go +++ b/oauthproxy.go @@ -263,7 +263,7 @@ func (p *OAuthProxy) MakeSessionCookie(req *http.Request, value string, expirati value = cookie.SignedValue(p.CookieSeed, p.CookieName, value, now) } c := p.makeCookie(req, p.CookieName, value, expiration, now) - if len(c.Value) > 4096 { + if len(c.Value) > 4096-len(p.CookieName) { return splitCookie(c) } return []*http.Cookie{c}