Merge pull request #3363 from skeeey/master

Document for cookie expires annotation
This commit is contained in:
Kubernetes Prow Robot 2019-01-14 07:52:28 -08:00 committed by GitHub
commit 1db9c91af4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 4 deletions

View file

@ -219,7 +219,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions",
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
local, _ := time.LoadLocation("GMT")
duration, _ := time.ParseDuration("48h")
expected := time.Date(1970, time.January, 1, 0, 0, 0, 0, local).Add(duration).Format("Mon, 02-Jan-06 15:04:05 MST")
expected := time.Now().In(local).Add(duration).Format("Mon, 02-Jan-06 15:04")
Expect(resp.Header.Get("Set-Cookie")).Should(ContainSubstring(fmt.Sprintf("Expires=%s", expected)))
Expect(resp.Header.Get("Set-Cookie")).Should(ContainSubstring("Max-Age=259200"))
})