...
|
...
|
@@ -153,10 +153,10 @@ end |
|
|
|
|
|
--forbid user agent
|
|
|
function forbid_ua()
|
|
|
local forbid_uas = {'python-requests'}
|
|
|
local forbid_ua_table = {'python-requests'}
|
|
|
local ua = http_request.get_ua()
|
|
|
for forbid_ua in forbid_uas do
|
|
|
if ua and string.find(ua, forbid_ua) then
|
|
|
for i = 1, #forbid_ua_table do
|
|
|
if ua and string.find(ua, forbid_ua_table[i]) then
|
|
|
ngx.log(ngx.ERR, "[User-Agent Not Allowed]", ua)
|
|
|
ngx.exist(HTTP_OK)
|
|
|
end
|
...
|
...
|
|