Merge 5f7e9d50f589dd826ed75a08989cc4542c51fcda into c3d1092b3b48addf6f9cd00fe274ec3bd14650eb

This commit is contained in:
Mohammad Reza Karimi 2025-10-11 15:10:43 +03:30 committed by GitHub
commit ce9a1a3278
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1081,6 +1081,16 @@ func (c *Context) Cookie(name string) (string, error) {
return val, nil
}
// Cookies parses and returns the HTTP cookies sent with the request.
func (c *Context) Cookies() map[string]string {
cookies := make(map[string]string)
for _, cookie := range c.Request.Cookies() {
val, _ := url.QueryUnescape(cookie.Value)
cookies[cookie.Name] = val
}
return cookies
}
// Render writes the response headers and calls render.Render to render data.
func (c *Context) Render(code int, r render.Render) {
c.Status(code)