From 5dcccae37dd740ea63dd945cc8b20704c85a9538 Mon Sep 17 00:00:00 2001 From: moicen Date: Sun, 7 May 2023 02:19:43 +0800 Subject: [PATCH] use ngx.var.host --- scripts/lib/upt.lua | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/scripts/lib/upt.lua b/scripts/lib/upt.lua index ae8198d..1bdedea 100644 --- a/scripts/lib/upt.lua +++ b/scripts/lib/upt.lua @@ -4,16 +4,8 @@ package.path = package.path .. ';/?.lua'; local _M = {} ---local strip_path = require("strip_path") ---local Upyun = require('upyun') - -function host(s) - return (s.."/"):match("://(.-)/") -end - - function _M.upt(uri) - local hostname = host(uri) + local hostname = ngx.var.host local secret; if (hostname == 'moicen.com') then