Skip to content

Commit 8e4d170

Browse files
authored
feature/cloudfront/sign: support SameSite option (#2477)
1 parent 7de26d9 commit 8e4d170

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id": "cf6b73af-a1c3-4ff1-9ea1-31f6ded22a5b",
3+
"type": "feature",
4+
"description": "Add http.SameSite config in CookieOptions.",
5+
"modules": [
6+
"feature/cloudfront/sign"
7+
]
8+
}

feature/cloudfront/sign/sign_cookie.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ const (
2020
// A CookieOptions optional additional options that can be applied to the signed
2121
// cookies.
2222
type CookieOptions struct {
23-
Path string
24-
Domain string
25-
Secure bool
23+
Path string
24+
Domain string
25+
Secure bool
26+
SameSite http.SameSite
2627
}
2728

2829
// apply will integration the options provided into the base cookie options
@@ -237,6 +238,7 @@ func createCookies(p *Policy, keyID string, privKey *rsa.PrivateKey, opt CookieO
237238
c.Path = opt.Path
238239
c.Domain = opt.Domain
239240
c.Secure = opt.Secure
241+
c.SameSite = opt.SameSite
240242
}
241243

242244
return cookies, nil

0 commit comments

Comments
 (0)