mirror of
https://github.com/gin-gonic/gin.git
synced 2025-05-24 22:09:46 +08:00
type of returned cookies changed.
This commit is contained in:
parent
eda6ff247f
commit
5f7e9d50f5
@ -898,11 +898,11 @@ func (c *Context) Cookie(name string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cookies parses and returns the HTTP cookies sent with the request.
|
// Cookies parses and returns the HTTP cookies sent with the request.
|
||||||
func (c *Context) Cookies() []string {
|
func (c *Context) Cookies() map[string]string {
|
||||||
var cookies []string
|
cookies := make(map[string]string)
|
||||||
for _, cookie := range c.Request.Cookies() {
|
for _, cookie := range c.Request.Cookies() {
|
||||||
val, _ := url.QueryUnescape(cookie.Value)
|
val, _ := url.QueryUnescape(cookie.Value)
|
||||||
cookies = append(cookies, val)
|
cookies[cookie.Name] = val
|
||||||
}
|
}
|
||||||
return cookies
|
return cookies
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user