MCPcopy
hub / github.com/danielgtaylor/huma / ReadCookies

Function ReadCookies

cookie.go:26–34  ·  view source on GitHub ↗

ReadCookies reads all cookies from the request headers.

(ctx Context)

Source from the content-addressed store, hash-verified

24
25// ReadCookies reads all cookies from the request headers.
26func ReadCookies(ctx Context) []*http.Cookie {
27 var headers []string
28 ctx.EachHeader(func(name, value string) {
29 if strings.EqualFold(name, "cookie") {
30 headers = append(headers, value)
31 }
32 })
33 return readCookies(headers, "")
34}
35
36// Everything below this line is copied from the Go standard library. None of
37// it is exported, so we have to copy it here to use it. 😭

Callers 1

RegisterFunction · 0.85

Calls 2

readCookiesFunction · 0.85
EachHeaderMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…