Fix cookie split should account for cookie name

This commit is contained in:
Joel Speed 2018-06-20 14:56:13 +01:00
parent ea4dfaf4d1
commit bc8b7d059b
No known key found for this signature in database
GPG Key ID: 83695B8B3A376982

View File

@ -265,7 +265,7 @@ func (p *OAuthProxy) MakeSessionCookie(req *http.Request, value string, expirati
value = cookie.SignedValue(p.CookieSeed, p.CookieName, value, now) value = cookie.SignedValue(p.CookieSeed, p.CookieName, value, now)
} }
c := p.makeCookie(req, p.CookieName, value, expiration, 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 splitCookie(c)
} }
return []*http.Cookie{c} return []*http.Cookie{c}