From 3379e05fec7adb2d69bb35560434c2ed1167a371 Mon Sep 17 00:00:00 2001 From: Brian Dwyer Date: Thu, 23 Feb 2017 18:48:34 -0500 Subject: [PATCH] Oversize Cookie Alert Cookies cannot be larger than 4kb --- oauthproxy.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/oauthproxy.go b/oauthproxy.go index f1a6920e7..362f4dd59 100644 --- a/oauthproxy.go +++ b/oauthproxy.go @@ -255,6 +255,10 @@ func (p *OAuthProxy) MakeCookie(req *http.Request, value string, expiration time if value != "" { value = cookie.SignedValue(p.CookieSeed, p.CookieName, value, now) + if len(value) > 4096 { + // Cookies cannot be larger than 4kb + log.Printf("WARNING - Cookie Size: %d bytes", len(value)) + } } return &http.Cookie{ Name: p.CookieName,