Skip to content

Commit

Permalink
Remove stickyness cookie domain from Lua balancer to match old behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
mxey committed Jan 11, 2019
1 parent 35f5a6c commit 66f707f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion rootfs/etc/nginx/lua/balancer/sticky.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ local function set_cookie(self, value)
key = self.cookie_name,
value = value,
path = cookie_path,
domain = ngx.var.host,
httponly = true,
secure = ngx.var.https == "on",
}
Expand Down
4 changes: 2 additions & 2 deletions rootfs/etc/nginx/lua/test/balancer/sticky_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ describe("Sticky", function()
local expected_len = #util[test_backend_hash_fn .. "_digest"]("anything")
assert.equal(#payload.value, expected_len)
assert.equal(payload.path, ngx.var.location_path)
assert.equal(payload.domain, ngx.var.host)
assert.equal(payload.domain, nil)
assert.equal(payload.httponly, true)
assert.equal(payload.secure, false)
return true, nil
Expand Down Expand Up @@ -148,7 +148,7 @@ describe("Sticky", function()
local expected_len = #util[test_backend_hash_fn .. "_digest"]("anything")
assert.equal(#payload.value, expected_len)
assert.equal(payload.path, ngx.var.location_path)
assert.equal(payload.domain, ngx.var.host)
assert.equal(payload.domain, nil)
assert.equal(payload.httponly, true)
assert.equal(payload.secure, true)
return true, nil
Expand Down

0 comments on commit 66f707f

Please sign in to comment.