From 39dd0c50dac91de5fc5a4856c49332a187756780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ga=C3=9F?= Date: Sat, 12 Jan 2019 02:24:45 +0100 Subject: [PATCH] Remove stickyness cookie domain from Lua balancer to match old behavior (#3648) --- rootfs/etc/nginx/lua/balancer/sticky.lua | 1 - rootfs/etc/nginx/lua/test/balancer/sticky_test.lua | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/rootfs/etc/nginx/lua/balancer/sticky.lua b/rootfs/etc/nginx/lua/balancer/sticky.lua index 1b82e5efd..3e542fe95 100644 --- a/rootfs/etc/nginx/lua/balancer/sticky.lua +++ b/rootfs/etc/nginx/lua/balancer/sticky.lua @@ -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", } diff --git a/rootfs/etc/nginx/lua/test/balancer/sticky_test.lua b/rootfs/etc/nginx/lua/test/balancer/sticky_test.lua index d1dc96939..8b9741d3f 100644 --- a/rootfs/etc/nginx/lua/test/balancer/sticky_test.lua +++ b/rootfs/etc/nginx/lua/test/balancer/sticky_test.lua @@ -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 @@ -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