getByHostAndPath returns cookies stored for a specific host and path.
(host, path []byte, secure bool)
| 79 | |
| 80 | // getByHostAndPath returns cookies stored for a specific host and path. |
| 81 | func (cj *CookieJar) getByHostAndPath(host, path []byte, secure bool) []*fasthttp.Cookie { |
| 82 | if cj.hostCookies == nil { |
| 83 | return nil |
| 84 | } |
| 85 | |
| 86 | var ( |
| 87 | err error |
| 88 | hostStr = utils.UnsafeString(host) |
| 89 | ) |
| 90 | |
| 91 | // port must not be included. |
| 92 | hostStr, _, err = net.SplitHostPort(hostStr) |
| 93 | if err != nil { |
| 94 | hostStr = utils.UnsafeString(host) |
| 95 | } |
| 96 | return cj.cookiesForRequest(hostStr, path, secure) |
| 97 | } |
| 98 | |
| 99 | // getCookiesByHost returns cookies stored for a specific host, removing any that have expired. |
| 100 | func (cj *CookieJar) getCookiesByHost(host string) []*fasthttp.Cookie { |
no test coverage detected