MCPcopy
hub / github.com/gofiber/fiber / Get

Method Get

client/cookiejar.go:71–78  ·  view source on GitHub ↗

Get returns all cookies stored for a given URI. If there are no cookies for the provided host, the returned slice will be nil. The CookieJar keeps its own copies of cookies, so it is safe to release the returned cookies after use.

(uri *fasthttp.URI)

Source from the content-addressed store, hash-verified

69// The CookieJar keeps its own copies of cookies, so it is safe to release the returned
70// cookies after use.
71func (cj *CookieJar) Get(uri *fasthttp.URI) []*fasthttp.Cookie {
72 if uri == nil {
73 return nil
74 }
75
76 secure := bytes.Equal(uri.Scheme(), httpsScheme)
77 return cj.getByHostAndPath(uri.Host(), uri.Path(), secure)
78}
79
80// getByHostAndPath returns cookies stored for a specific host and path.
81func (cj *CookieJar) getByHostAndPath(host, path []byte, secure bool) []*fasthttp.Cookie {

Calls 4

getByHostAndPathMethod · 0.95
SchemeMethod · 0.65
HostMethod · 0.65
PathMethod · 0.65