Skip to content

Commit

Permalink
Oversize Cookie Alert
Browse files Browse the repository at this point in the history
Cookies cannot be larger than 4kb
  • Loading branch information
bdwyertech authored and John Wells committed Dec 1, 2017
1 parent 18908fd commit a7be88d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions oauthproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,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,
Expand Down

0 comments on commit a7be88d

Please sign in to comment.