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

Method getByHostAndPath

client/cookiejar.go:81–97  ·  view source on GitHub ↗

getByHostAndPath returns cookies stored for a specific host and path.

(host, path []byte, secure bool)

Source from the content-addressed store, hash-verified

79
80// getByHostAndPath returns cookies stored for a specific host and path.
81func (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.
100func (cj *CookieJar) getCookiesByHost(host string) []*fasthttp.Cookie {

Callers 2

GetMethod · 0.95
dumpCookiesToReqMethod · 0.95

Calls 1

cookiesForRequestMethod · 0.95

Tested by

no test coverage detected