Skip to content

Commit

Permalink
expire -> expires, changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws committed Nov 1, 2024
1 parent e6aaa01 commit a73b2c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .changelog/457746bef3eb4ef08b5b25548f5cf5d2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "457746be-f3eb-4ef0-8b5b-25548f5cf5d2",
"type": "feature",
"description": "Add Expires field to CookieOptions.",
"modules": [
"feature/cloudfront/sign"
]
}
8 changes: 4 additions & 4 deletions feature/cloudfront/sign/sign_cookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type CookieOptions struct {
Domain string
Secure bool
SameSite http.SameSite
Expire time.Time
Expires time.Time
}

// apply will integration the options provided into the base cookie options
Expand Down Expand Up @@ -220,19 +220,19 @@ func createCookies(p *Policy, keyID string, privKey *rsa.PrivateKey, opt CookieO
Name: CookiePolicyName,
Value: string(b64Policy),
HttpOnly: true,
Expires: opt.Expire,
Expires: opt.Expires,
}
cSignature := &http.Cookie{
Name: CookieSignatureName,
Value: string(b64Sig),
HttpOnly: true,
Expires: opt.Expire,
Expires: opt.Expires,
}
cKey := &http.Cookie{
Name: CookieKeyIDName,
Value: keyID,
HttpOnly: true,
Expires: opt.Expire,
Expires: opt.Expires,
}

cookies := []*http.Cookie{cPolicy, cSignature, cKey}
Expand Down

0 comments on commit a73b2c2

Please sign in to comment.