Skip to content

Commit

Permalink
feature/cloudfront/sign: support SameSite option (#2477)
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Mar 4, 2024
1 parent 7de26d9 commit 8e4d170
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .changelog/cf6b73afa1c34ff19ea131f6ded22a5b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "cf6b73af-a1c3-4ff1-9ea1-31f6ded22a5b",
"type": "feature",
"description": "Add http.SameSite config in CookieOptions.",
"modules": [
"feature/cloudfront/sign"
]
}
8 changes: 5 additions & 3 deletions feature/cloudfront/sign/sign_cookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ const (
// A CookieOptions optional additional options that can be applied to the signed
// cookies.
type CookieOptions struct {
Path string
Domain string
Secure bool
Path string
Domain string
Secure bool
SameSite http.SameSite
}

// apply will integration the options provided into the base cookie options
Expand Down Expand Up @@ -237,6 +238,7 @@ func createCookies(p *Policy, keyID string, privKey *rsa.PrivateKey, opt CookieO
c.Path = opt.Path
c.Domain = opt.Domain
c.Secure = opt.Secure
c.SameSite = opt.SameSite
}

return cookies, nil
Expand Down

0 comments on commit 8e4d170

Please sign in to comment.