git.iko.soy/typeable/oauth2-proxy
on master help sign in
change cookie index separator to underscore
commita339baf94e5f4a5ab20813b539b25d4cb92685ca authorMarcel Juhnke <marrat@marrat.de> dateThu 31 Jan 2019, 20:05 (8 years ago) parentb5b0633
1 file changed+3−3
oauthproxy.go+3−3
oauthproxy.go+3−3
@@ -329,7 +329,7 @@ func splitCookie(c *http.Cookie) []*http.Cookie {
329329 count := 0
330330 for len(valueBytes) > 0 {
331331 new := copyCookie(c)
332− new.Name = fmt.Sprintf("%s-%d", c.Name, count)
332+ new.Name = fmt.Sprintf("%s_%d", c.Name, count)
333333 count++
334334 if len(valueBytes) < maxCookieLength {
335335 new.Value = string(valueBytes)
@@ -357,7 +357,7 @@ func joinCookies(cookies []*http.Cookie) (*http.Cookie, error) {
357357 for i := 1; i < len(cookies); i++ {
358358 c.Value += cookies[i].Value
359359 }
360− c.Name = strings.TrimRight(c.Name, "-0")
360+ c.Name = strings.TrimRight(c.Name, "_0")
361361 return c, nil
362362}
363363
@@ -374,7 +374,7 @@ func loadCookie(req *http.Request, cookieName string) (*http.Cookie, error) {
374374 count := 0
375375 for err == nil {
376376 var c *http.Cookie
377− c, err = req.Cookie(fmt.Sprintf("%s-%d", cookieName, count))
377+ c, err = req.Cookie(fmt.Sprintf("%s_%d", cookieName, count))
378378 if err == nil {
379379 cookies = append(cookies, c)
380380 count++