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