mirror of
https://github.com/infinite-iroha/touka.git
synced 2026-06-13 15:47:38 +08:00
fix(cookie): add warning log when multiple SameSite values provided
This commit is contained in:
parent
7be49b96c8
commit
9f210deadf
1 changed files with 3 additions and 0 deletions
|
|
@ -1167,6 +1167,9 @@ func (c *Context) SetCookie(name, value string, maxAge int, path, domain string,
|
||||||
}
|
}
|
||||||
site := c.sameSite
|
site := c.sameSite
|
||||||
if len(sameSite) > 0 {
|
if len(sameSite) > 0 {
|
||||||
|
if len(sameSite) > 1 {
|
||||||
|
c.Warnf("SetCookie: only the first SameSite value will be used, got %d values", len(sameSite))
|
||||||
|
}
|
||||||
site = sameSite[0]
|
site = sameSite[0]
|
||||||
}
|
}
|
||||||
http.SetCookie(c.Writer, &http.Cookie{
|
http.SetCookie(c.Writer, &http.Cookie{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue