Document that the cookie passed to ResponseHeader.SetCookie may be re-used after the function returns

This commit is contained in:
Aliaksandr Valialkin
2017-01-18 19:20:47 +02:00
parent b0de56d13b
commit 2ada93a6df
+2
View File
@@ -946,6 +946,8 @@ func (h *ResponseHeader) SetCanonical(key, value []byte) {
}
// SetCookie sets the given response cookie.
//
// It is save re-using the cookie after the function returns.
func (h *ResponseHeader) SetCookie(cookie *Cookie) {
h.cookies = setArgBytes(h.cookies, cookie.Key(), cookie.Cookie())
}