You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-08-08 22:46:33 +02:00
pkg/cookies: use 'Max-Age' instead of 'Expires' for cookie expiration
This commit is contained in:
@ -159,10 +159,10 @@ var _ = Describe("CSRF Cookie with non-fixed name Tests", func() {
|
||||
))
|
||||
Expect(rw.Header().Get("Set-Cookie")).To(ContainSubstring(
|
||||
fmt.Sprintf(
|
||||
"; Path=%s; Domain=%s; Expires=%s; HttpOnly; Secure",
|
||||
"; Path=%s; Domain=%s; Max-Age=%d; HttpOnly; Secure",
|
||||
cookiePath,
|
||||
cookieDomain,
|
||||
testCookieExpires(testNow.Add(cookieOpts.CSRFExpire)),
|
||||
int(cookieOpts.CSRFExpire.Seconds()),
|
||||
),
|
||||
))
|
||||
})
|
||||
@ -176,11 +176,10 @@ var _ = Describe("CSRF Cookie with non-fixed name Tests", func() {
|
||||
|
||||
Expect(rw.Header().Get("Set-Cookie")).To(Equal(
|
||||
fmt.Sprintf(
|
||||
"%s=; Path=%s; Domain=%s; Expires=%s; HttpOnly; Secure",
|
||||
"%s=; Path=%s; Domain=%s; Max-Age=0; HttpOnly; Secure",
|
||||
privateCSRF.cookieName(),
|
||||
cookiePath,
|
||||
cookieDomain,
|
||||
testCookieExpires(testNow.Add(time.Hour*-1)),
|
||||
),
|
||||
))
|
||||
})
|
||||
|
Reference in New Issue
Block a user