From 4e769716aa2a79002e09d2927c7f1b8c7fdf960f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=94=B7?= Date: Sun, 7 May 2023 23:58:40 +0800 Subject: [PATCH] fix domain matching in upt --- scripts/lib/upt.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/lib/upt.lua b/scripts/lib/upt.lua index 827a06f..e9a97e9 100644 --- a/scripts/lib/upt.lua +++ b/scripts/lib/upt.lua @@ -17,11 +17,18 @@ function _M.upt(url) ngx.log(ngx.INFO, 'hostname...' .. hostname .. ' path...' .. pathname) local secret; if string.find(hostname, "moicen.com") then + ngx.log(ngx.INFO, 'match moicen.com: ' .. ngx.var.upt_moicen_secret) secret = ngx.var.upt_moicen_secret elseif string.find(hostname, "alchemy-studio.cn") then + ngx.log(ngx.INFO, 'match alchemy-studio.cn: ' .. ngx.var.upt_alchemy_secret) secret = ngx.var.upt_alchemy_secret elseif string.find(hostname, "huiwings.cn") then + ngx.log(ngx.INFO, 'match huiwings.cn: ' .. ngx.var.upt_huiwings_secret) secret = ngx.var.upt_huiwings_secret + else + ngx.status = 401 + ngx.log(ngx.ERR, "Reject URL -> ", hostname) + ngx.exit(ngx.status) end ngx.log(ngx.INFO, 'secret...' .. secret)