This commit is contained in:
XiaoLi
2022-08-28 22:13:24 +08:00
committed by 阿男
parent 33cede63aa
commit 686c3f9775
+2 -4
View File
@@ -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