Skip to content
Snippets Groups Projects
Commit 4f39c341 authored by Rohith's avatar Rohith
Browse files

Authentication Cookies

- need to use a prefix rather than just the name due to the cookie being split
parent 87f0b9cd
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ import ( ...@@ -21,6 +21,7 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"path" "path"
"strings"
"time" "time"
"github.com/gambol99/go-oidc/jose" "github.com/gambol99/go-oidc/jose"
...@@ -39,7 +40,7 @@ func filterCookies(req *http.Request, filter []string) error { ...@@ -39,7 +40,7 @@ func filterCookies(req *http.Request, filter []string) error {
var found bool var found bool
// @step: does this cookie match our filter? // @step: does this cookie match our filter?
for _, n := range filter { for _, n := range filter {
if x.Name == n { if strings.HasPrefix(x.Name, n) {
req.AddCookie(&http.Cookie{Name: x.Name, Value: "censored"}) req.AddCookie(&http.Cookie{Name: x.Name, Value: "censored"})
found = true found = true
break break
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment