jokyone commited on
Commit
a25a4c6
1 Parent(s): cbaaaf5

Update main.go

Browse files
Files changed (1) hide show
  1. main.go +3 -0
main.go CHANGED
@@ -21,6 +21,9 @@ func init() {
21
  func filterCookieValues(cookieValues string, keepKeys []string) string {
22
  newCookieValues := ""
23
  pairs := strings.Split(cookieValues, ";")
 
 
 
24
  for _, pair := range pairs {
25
  parts := strings.Split(pair, "=")
26
  key := strings.TrimSpace(parts[0])
 
21
  func filterCookieValues(cookieValues string, keepKeys []string) string {
22
  newCookieValues := ""
23
  pairs := strings.Split(cookieValues, ";")
24
+ if len(pairs) < 2 {
25
+ return newCookieValues
26
+ }
27
  for _, pair := range pairs {
28
  parts := strings.Split(pair, "=")
29
  key := strings.TrimSpace(parts[0])