CookieIncluded reports whether the "cookie.Name" is in the list of "cookieNames". Notes: If "cookieNames" slice is empty then it returns true, If "cookie.Name" is empty then it returns false.
(cookie *http.Cookie, cookieNames []string)
| 5572 | // If "cookieNames" slice is empty then it returns true, |
| 5573 | // If "cookie.Name" is empty then it returns false. |
| 5574 | func CookieIncluded(cookie *http.Cookie, cookieNames []string) bool { |
| 5575 | if cookie.Name == "" { |
| 5576 | return false |
| 5577 | } |
| 5578 | |
| 5579 | if len(cookieNames) > 0 { |
| 5580 | for _, name := range cookieNames { |
| 5581 | if cookie.Name == name { |
| 5582 | return true |
| 5583 | } |
| 5584 | } |
| 5585 | |
| 5586 | return false |
| 5587 | } |
| 5588 | |
| 5589 | return true |
| 5590 | } |
| 5591 | |
| 5592 | // var cookieNameSanitizer = strings.NewReplacer("\n", "-", "\r", "-") |
| 5593 | // |
no outgoing calls
no test coverage detected
searching dependent graphs…