mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
Remove debug prints
This commit is contained in:
@@ -8,7 +8,6 @@ local backends_map = Map.new('/etc/haproxy/map/backends.map', Map._str)
|
|||||||
function get_server_names(txn)
|
function get_server_names(txn)
|
||||||
local key = txn.sf:hdr("Host")
|
local key = txn.sf:hdr("Host")
|
||||||
local user_cn = txn:get_var("txn.xcn") or "XX"
|
local user_cn = txn:get_var("txn.xcn") or "XX"
|
||||||
print(user_cn)
|
|
||||||
local value = backends_map:lookup(key or "")
|
local value = backends_map:lookup(key or "")
|
||||||
if value ~= nil then
|
if value ~= nil then
|
||||||
local filtered_backends = {}
|
local filtered_backends = {}
|
||||||
@@ -27,12 +26,10 @@ function get_server_names(txn)
|
|||||||
-- Randomly select from filtered backends if available
|
-- Randomly select from filtered backends if available
|
||||||
if #filtered_backends > 0 then
|
if #filtered_backends > 0 then
|
||||||
local s = filtered_backends[math.random(#filtered_backends)]
|
local s = filtered_backends[math.random(#filtered_backends)]
|
||||||
print(s)
|
|
||||||
return s
|
return s
|
||||||
elseif #all_backends > 0 then
|
elseif #all_backends > 0 then
|
||||||
-- If no filtered backends, randomly select from all backends
|
-- If no filtered backends, randomly select from all backends
|
||||||
local s = all_backends[math.random(#all_backends)]
|
local s = all_backends[math.random(#all_backends)]
|
||||||
print(s)
|
|
||||||
return s
|
return s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user