pkg/http: Error on SetCookie
if cookie handler is request aware.
Signed-off-by: Mark Laing <mark.laing@canonical.com>
This commit is contained in:
parent
eae9da5e4c
commit
05e528cff0
1 changed files with 4 additions and 0 deletions
|
@ -97,6 +97,10 @@ func (c *CookieHandler) CheckQueryCookie(r *http.Request, name string) (string,
|
|||
}
|
||||
|
||||
func (c *CookieHandler) SetCookie(w http.ResponseWriter, name, value string) error {
|
||||
if c.IsRequestAware() {
|
||||
return errors.New("Cookie handler is request aware")
|
||||
}
|
||||
|
||||
encoded, err := c.securecookie.Encode(name, value)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue