Update output.go
add SameSite for Cookie
This commit is contained in:
parent
61f5ce8c6c
commit
4fa797feaa
@ -155,6 +155,13 @@ func (output *BeegoOutput) Cookie(name string, value string, others ...interface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// default empty
|
||||||
|
if len(others) > 5 {
|
||||||
|
if v, ok := others[5].(string); ok && len(v) > 0 {
|
||||||
|
fmt.Fprintf(&b, "; SameSite=%s", sanitizeValue(v))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
output.Context.ResponseWriter.Header().Add("Set-Cookie", b.String())
|
output.Context.ResponseWriter.Header().Add("Set-Cookie", b.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user