From 1446f0c75f29a5a1102c40f7a7a2bec478f2bad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=94=B7?= Date: Sun, 23 Jul 2023 23:21:32 +0800 Subject: [PATCH] add log --- scripts/lib/upyun.lua | 1 + scripts/lib/upyun_upload.lua | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/lib/upyun.lua b/scripts/lib/upyun.lua index 744badb..9647e84 100644 --- a/scripts/lib/upyun.lua +++ b/scripts/lib/upyun.lua @@ -411,6 +411,7 @@ local function _parse_upyun_option(option, extra, content) if omd5 == "true" then extra["Content-MD5"] = md5(content) + ngx.log(ngx.INFO, "Content-MD5" .. extra["Content-MD5"]) end if type(secret) == "string" then diff --git a/scripts/lib/upyun_upload.lua b/scripts/lib/upyun_upload.lua index be806ea..d489f93 100644 --- a/scripts/lib/upyun_upload.lua +++ b/scripts/lib/upyun_upload.lua @@ -44,8 +44,8 @@ function upyun_upload.upload(filepath, filename, retry) local info, err = upyun:upload_file(savePath, nil, options) if not info then - local error_table = json.decode(err) + ngx.log(ngx.INFO, "Upyun Upload File Error: " .. err) ngx.log(ngx.ERR, '[' .. error_table["code"] .. ']') if (error_table["code"] == 40000006) @@ -57,7 +57,6 @@ function upyun_upload.upload(filepath, filename, retry) ngx.status = 400 ngx.log(ngx.ERR, "failed to upload file : " .. '[' .. err .. ']') end - else ngx.status = 200 local fullpath = ngx.var.upyun_domain .. "/" .. directory .. "/" .. filename