v1.2.5 - performance improvement

This commit is contained in:
bunkerity
2021-05-14 16:42:08 +02:00
parent 2f115c444d
commit b0ca85ff75
3 changed files with 4 additions and 4 deletions

View File

@@ -134,7 +134,7 @@ if use_tor_exit_nodes then
end
-- check if user-agent is allowed
if use_user_agents then
if use_user_agents and ngx.var.http_user_agent ~= nil then
local whitelisted = false
for k, v in pairs(whitelist_user_agent) do
if string.match(ngx.var.http_user_agent, v) then
@@ -167,7 +167,7 @@ if use_user_agents then
end
-- check if referrer is allowed
if use_referrer then
if use_referrer and ngx.var.http_referer ~= nil then
local value, flags = ngx.shared.referrers_cache:get(ngx.var.http_referer)
if value == nil then
local patterns = ngx.shared.referrers_data:get_keys(0)