From ee17b2f17565d617d9b397026487184af61084b5 Mon Sep 17 00:00:00 2001 From: moicen Date: Sun, 7 May 2023 02:29:38 +0800 Subject: [PATCH] fix check logic --- scripts/lib/upt.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/lib/upt.lua b/scripts/lib/upt.lua index fca2543..1435856 100644 --- a/scripts/lib/upt.lua +++ b/scripts/lib/upt.lua @@ -4,8 +4,12 @@ package.path = package.path .. ';/?.lua'; local _M = {} +function host(s) + return (s.."/"):match("://(.-)/") +end + function _M.upt(uri) - local hostname = ngx.var.host + local hostname = host(uri) ngx.log(ngx.INFO, 'hostname...', hostname) local secret; if string.find(hostname, "moicen.com") then