Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
[KEYCLOAK-11611] Broken tests for cookies on Gatekeeper
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Oliveira da Silva committed Oct 2, 2019
1 parent 9c5c77d commit 11b88cf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cookies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func TestDropCookie(t *testing.T) {
p.config.SecureCookie = true
p.dropCookie(resp, req.Host, "test-cookie", "test-value", 0)
assert.NotEqual(t, resp.Header().Get("Set-Cookie"),
"test-cookie=test-value; Path=/; Domain=127.0.0.2; HttpOnly; Secure",
"test-cookie=test-value; Path=/; HttpOnly; Secure",
"we have not set the cookie, headers: %v", resp.Header())

p.config.CookieDomain = "test.com"
Expand Down Expand Up @@ -174,7 +174,7 @@ func TestSameSiteCookie(t *testing.T) {
p.dropCookie(resp, req.Host, "test-cookie", "test-value", 0)

assert.Equal(t, resp.Header().Get("Set-Cookie"),
"test-cookie=test-value; Path=/; Domain=127.0.0.1",
"test-cookie=test-value; Path=/",
"we have not set the cookie, headers: %v", resp.Header())

req = newFakeHTTPRequest("GET", "/admin")
Expand All @@ -183,7 +183,7 @@ func TestSameSiteCookie(t *testing.T) {
p.dropCookie(resp, req.Host, "test-cookie", "test-value", 0)

assert.Equal(t, resp.Header().Get("Set-Cookie"),
"test-cookie=test-value; Path=/; Domain=127.0.0.1; SameSite=Strict",
"test-cookie=test-value; Path=/; SameSite=Strict",
"we have not set the cookie, headers: %v", resp.Header())

req = newFakeHTTPRequest("GET", "/admin")
Expand All @@ -192,7 +192,7 @@ func TestSameSiteCookie(t *testing.T) {
p.dropCookie(resp, req.Host, "test-cookie", "test-value", 0)

assert.Equal(t, resp.Header().Get("Set-Cookie"),
"test-cookie=test-value; Path=/; Domain=127.0.0.1; SameSite=Lax",
"test-cookie=test-value; Path=/; SameSite=Lax",
"we have not set the cookie, headers: %v", resp.Header())

req = newFakeHTTPRequest("GET", "/admin")
Expand All @@ -201,7 +201,7 @@ func TestSameSiteCookie(t *testing.T) {
p.dropCookie(resp, req.Host, "test-cookie", "test-value", 0)

assert.Equal(t, resp.Header().Get("Set-Cookie"),
"test-cookie=test-value; Path=/; Domain=127.0.0.1",
"test-cookie=test-value; Path=/",
"we have not set the cookie, headers: %v", resp.Header())
}

Expand Down

0 comments on commit 11b88cf

Please sign in to comment.