Merge 5f7e9d50f589dd826ed75a08989cc4542c51fcda into 9914178584e42458ff7d23891463a880f58c9d86

This commit is contained in:
Mohammad Reza Karimi 2026-01-04 09:48:31 +03:30 committed by GitHub
commit fccaf176c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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