Open gaul opened 7 years ago
It passed the tests as you can see in https://travis-ci.org/ahmetb/go-httpbin/builds/210435220
This test succeeds with go 1.7.5 and fails with 1.8. The test is actually wrong; it sets three cookies, deletes two, then checks to see if all three remain.
We don't just check if all 3 exists. We check that 2 are unset (to empty value), 1 is modified but all 3 are present. Since it worked this way with go1.7 just fine, I've reason to believe that either the CookieJar implementation or the http.Client's way of dealing with cookies has changed.
For a cookie defined like this:
http.Cookie{ Name: "k1", Value: "", Path: "/", Expires: time.Unix(0, 0), MaxAge: 0, }
Go 1.7 produce the following string:
k1=; Path=/
While Go 1.9 produce the following string:
k1=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT
This is due to the following fix https://github.com/golang/go/commit/d86a6ef0c7e8307802c6cd3f623bade3e78a42bf
So now in 1.9 you have a real deletion of the cookie thanks to the expiration time that is correctly set.
Please enable Travis CI to prevent regressions like the current one in 2af00d7564ba42267de040990a6588f1ca299315: