ReadCookies reads all cookies from the request headers.
(ctx Context)
| 24 | |
| 25 | // ReadCookies reads all cookies from the request headers. |
| 26 | func 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. 😭 |
no test coverage detected
searching dependent graphs…