File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ describe("Sticky", function()
7373 end )
7474
7575 local test_backend = get_test_backend ()
76- local test_backend_endpoint = test_backend . endpoints [ 1 ]. address .. " : " .. test_backend .endpoints [1 ]. port
76+ local test_backend_endpoint = util . get_endpoint_string ( test_backend .endpoints [1 ])
7777
7878 local legacy_cookie_value = test_backend_endpoint
7979 local function create_current_cookie_value (backend_key )
Original file line number Diff line number Diff line change @@ -13,12 +13,16 @@ local re_gmatch = ngx.re.gmatch
1313
1414local _M = {}
1515
16+ function _M .get_endpoint_string (endpoint )
17+ return endpoint .address .. " :" .. endpoint .port
18+ end
19+
1620function _M .get_nodes (endpoints )
1721 local nodes = {}
1822 local weight = 1
1923
2024 for _ , endpoint in pairs (endpoints ) do
21- local endpoint_string = endpoint . address .. " : " .. endpoint . port
25+ local endpoint_string = _M . get_endpoint_string ( endpoint )
2226 nodes [endpoint_string ] = weight
2327 end
2428
You can’t perform that action at this time.
0 commit comments