dumpCookiesToReq writes the stored cookies to the given request.
(req *fasthttp.Request)
| 271 | |
| 272 | // dumpCookiesToReq writes the stored cookies to the given request. |
| 273 | func (cj *CookieJar) dumpCookiesToReq(req *fasthttp.Request) { |
| 274 | uri := req.URI() |
| 275 | secure := bytes.Equal(uri.Scheme(), httpsScheme) |
| 276 | cookies := cj.getByHostAndPath(uri.Host(), uri.Path(), secure) |
| 277 | for _, cookie := range cookies { |
| 278 | req.Header.SetCookieBytesKV(cookie.Key(), cookie.Value()) |
| 279 | fasthttp.ReleaseCookie(cookie) |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | // parseCookiesFromResp parses the cookies from the response and stores them for the specified host and path. |
| 284 | func (cj *CookieJar) parseCookiesFromResp(host, _ []byte, resp *fasthttp.Response) { |
no test coverage detected