Merge 5f7e9d50f589dd826ed75a08989cc4542c51fcda into 915e4c90d28ec4cffc6eb146e208ab5a65eac772

This commit is contained in:
Mohammad Reza Karimi 2025-12-27 14:56:14 +03:30 committed by GitHub
commit afd2f48196
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1122,6 +1122,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)