Release releases all stored cookies. After this, the CookieJar is empty and must not be used again.
()
| 403 | // Release releases all stored cookies. After this, the CookieJar is empty and |
| 404 | // must not be used again. |
| 405 | func (cj *CookieJar) Release() { |
| 406 | // FOLLOW-UP performance optimization: |
| 407 | // Currently, a race condition is found because the reset method modifies a value |
| 408 | // that is not a copy but a reference. A solution would be to make a copy. |
| 409 | // for _, v := range cj.hostCookies { |
| 410 | // for _, c := range v { |
| 411 | // fasthttp.ReleaseCookie(c) |
| 412 | // } |
| 413 | // } |
| 414 | cj.hostCookies = nil |
| 415 | } |
| 416 | |
| 417 | // searchCookieByKeyAndPath looks up a cookie by its key and path from the provided slice of cookies. |
| 418 | func searchCookieByKeyAndPath(key, path []byte, cookies []storedCookie) *fasthttp.Cookie { |
no outgoing calls
no test coverage detected