From a339baf94e5f4a5ab20813b539b25d4cb92685ca Mon Sep 17 00:00:00 2001 From: Marcel Juhnke Date: Thu, 31 Jan 2019 20:05:47 +0100 Subject: [PATCH] change cookie index separator to underscore --- oauthproxy.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oauthproxy.go b/oauthproxy.go index 9c82d4f..6fee5df 100644 --- a/oauthproxy.go +++ b/oauthproxy.go @@ -329,7 +329,7 @@ func splitCookie(c *http.Cookie) []*http.Cookie { count := 0 for len(valueBytes) > 0 { new := copyCookie(c) - new.Name = fmt.Sprintf("%s-%d", c.Name, count) + new.Name = fmt.Sprintf("%s_%d", c.Name, count) count++ if len(valueBytes) < maxCookieLength { new.Value = string(valueBytes) @@ -357,7 +357,7 @@ func joinCookies(cookies []*http.Cookie) (*http.Cookie, error) { for i := 1; i < len(cookies); i++ { c.Value += cookies[i].Value } - c.Name = strings.TrimRight(c.Name, "-0") + c.Name = strings.TrimRight(c.Name, "_0") return c, nil } @@ -374,7 +374,7 @@ func loadCookie(req *http.Request, cookieName string) (*http.Cookie, error) { count := 0 for err == nil { var c *http.Cookie - c, err = req.Cookie(fmt.Sprintf("%s-%d", cookieName, count)) + c, err = req.Cookie(fmt.Sprintf("%s_%d", cookieName, count)) if err == nil { cookies = append(cookies, c) count++