Fix tests for GetCookie() and SetCookie()

This commit is contained in:
Javier Provecho Fernandez
2015-10-02 12:37:51 +02:00
parent 45b72951af
commit 8e37eb8498
2 changed files with 8 additions and 10 deletions

View File

@ -349,13 +349,13 @@ func (c *Context) SetCookie(
c.Writer.Header().Add("Set-Cookie", cookie.String())
}
func (c *Context) GetCookie(name string) string {
func (c *Context) GetCookie(name string) (string, error) {
cookie, err := c.Request.Cookie(name)
if err != nil {
return ""
return "", err
}
val, _ := url.QueryUnescape(cookie.Value)
return val
return val, nil
}
func (c *Context) Render(code int, r render.Render) {