From 4f39c3419b0ce556da007717152dd2ae451dedf4 Mon Sep 17 00:00:00 2001 From: Rohith <gambol99@gmail.com> Date: Sun, 26 Nov 2017 22:30:41 +0000 Subject: [PATCH] Authentication Cookies - need to use a prefix rather than just the name due to the cookie being split --- misc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc.go b/misc.go index eab4fd8..e308ecf 100644 --- a/misc.go +++ b/misc.go @@ -21,6 +21,7 @@ import ( "fmt" "net/http" "path" + "strings" "time" "github.com/gambol99/go-oidc/jose" @@ -39,7 +40,7 @@ func filterCookies(req *http.Request, filter []string) error { var found bool // @step: does this cookie match our filter? for _, n := range filter { - if x.Name == n { + if strings.HasPrefix(x.Name, n) { req.AddCookie(&http.Cookie{Name: x.Name, Value: "censored"}) found = true break -- GitLab