diff --git a/.changelog/457746bef3eb4ef08b5b25548f5cf5d2.json b/.changelog/457746bef3eb4ef08b5b25548f5cf5d2.json new file mode 100644 index 00000000000..29078007b03 --- /dev/null +++ b/.changelog/457746bef3eb4ef08b5b25548f5cf5d2.json @@ -0,0 +1,8 @@ +{ + "id": "457746be-f3eb-4ef0-8b5b-25548f5cf5d2", + "type": "feature", + "description": "Add Expires field to CookieOptions.", + "modules": [ + "feature/cloudfront/sign" + ] +} \ No newline at end of file diff --git a/feature/cloudfront/sign/sign_cookie.go b/feature/cloudfront/sign/sign_cookie.go index 9f0f8a5f00e..7e6d9aa1e5d 100644 --- a/feature/cloudfront/sign/sign_cookie.go +++ b/feature/cloudfront/sign/sign_cookie.go @@ -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 @@ -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}