From 686c3f9775abb3736acacf62c1b73e8a242935ce Mon Sep 17 00:00:00 2001 From: XiaoLi Date: Sun, 28 Aug 2022 22:13:24 +0800 Subject: [PATCH] update --- scripts/lib/upyun_download.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/lib/upyun_download.lua b/scripts/lib/upyun_download.lua index 3160c9d..68fcaa1 100644 --- a/scripts/lib/upyun_download.lua +++ b/scripts/lib/upyun_download.lua @@ -38,11 +38,9 @@ function _M.upyun_download(httpc, cjson, Upt, pl, uri) resp = "" end ngx.log(ngx.ERR, "FAILED TO CONNECT TO *UPYUN*: httpc throws runtime error, please check log. / ", pl.write(resp)) - -- 必须先设置ngx.status,否则ngx.say之后就直接被设置为200了,不会再被exit设为401 - -- https://github.com/openresty/lua-resty-redis/issues/15 - ngx.status = 401 + ngx.status = resp.status ngx.say(cjson.encode({r = false, d = "UpyunDownloadErr"})) - ngx.exit(401) + ngx.exit(resp.status) end