MCPcopy Create free account
hub / github.com/aurora-develop/aurora / SetCookies

Method SetCookies

httpclient/bogdanfinn/tls_client.go:104–130  ·  view source on GitHub ↗
(rawUrl string, cookies []*http.Cookie)

Source from the content-addressed store, hash-verified

102}
103
104func (t *TlsClient) SetCookies(rawUrl string, cookies []*http.Cookie) {
105 if cookies == nil {
106 return
107 }
108 u, err := url.Parse(rawUrl)
109 if err != nil {
110 return
111 }
112 var fcookies []*fhttp.Cookie
113 for _, c := range cookies {
114 fcookies = append(fcookies, &fhttp.Cookie{
115 Name: c.Name,
116 Value: c.Value,
117 Path: c.Path,
118 Domain: c.Domain,
119 Expires: c.Expires,
120 RawExpires: c.RawExpires,
121 MaxAge: c.MaxAge,
122 Secure: c.Secure,
123 HttpOnly: c.HttpOnly,
124 SameSite: fhttp.SameSite(c.SameSite),
125 Raw: c.Raw,
126 Unparsed: c.Unparsed,
127 })
128 }
129 t.Client.GetCookieJar().SetCookies(u, fcookies)
130}
131
132func (t *TlsClient) GetCookies(rawUrl string) []*http.Cookie {
133 currUrl, err := url.Parse(rawUrl)

Callers

nothing calls this directly

Calls 1

SetCookiesMethod · 0.65

Tested by

no test coverage detected