diff --git a/scripts/lib/upyun.lua b/scripts/lib/upyun.lua index 2bd60da..744badb 100644 --- a/scripts/lib/upyun.lua +++ b/scripts/lib/upyun.lua @@ -411,7 +411,6 @@ local function _parse_upyun_option(option, extra, content) if omd5 == "true" then extra["Content-MD5"] = md5(content) - --extra["Content-MD5"] = "cca354111e1980bec172a68718976c8" end if type(secret) == "string" then @@ -422,7 +421,6 @@ local function _parse_upyun_option(option, extra, content) extra["Content-Type"] = otype end - --print('options...', extra["Content-MD5"]) end local function _parse_upyun_headers(headers, regex) diff --git a/scripts/lib/upyun_upload.lua b/scripts/lib/upyun_upload.lua index 3ea047a..cfd0a6c 100644 --- a/scripts/lib/upyun_upload.lua +++ b/scripts/lib/upyun_upload.lua @@ -12,8 +12,6 @@ function upyun_upload.upload(filepath, filename) local upyun, err = Upyun:new({ user = ngx.var.upyun_operator, passwd = ngx.var.upyun_password, - --user = "moicen", - --passwd = "NyJ51zRwFApY9Wo9EHJMrb8GI9YtvpVN", localFilePath = filepath }) @@ -25,8 +23,6 @@ function upyun_upload.upload(filepath, filename) local bucket = ngx.var.upyun_bucket local directory = ngx.var.upyun_directory - --local bucket = "huiwing" - --local directory = "music-room" if not filename then filename = strip_path.strip_path(filepath) end @@ -49,9 +45,7 @@ function upyun_upload.upload(filepath, filename) else ngx.status = 200 local fullpath = ngx.var.upyun_domain .. "/" .. directory .. "/" .. filename - --local fullpath = "https://upyun.huiwings.cn" .. "/" .. directory .. "/" .. filename ngx.log(ngx.INFO, "SUCCESS UPLOAD -> UPYUN URL -> ", fullpath) - --ngx.say("SUCCESS UPLOAD -> UPYUN URL -> ", fullpath) ngx.say(fullpath) end end diff --git a/test_scripts/upyun_op.lua b/test_scripts/upyun_op.lua deleted file mode 100644 index 6dce441..0000000 --- a/test_scripts/upyun_op.lua +++ /dev/null @@ -1,13 +0,0 @@ ---package.path = package.path .. ';/?.lua'; -package.path = package.path .. ';/Users/liyong/Code/AlchemyStudio/resty_functions/scripts/?.lua'; - -ngx.say('UPLOAD COMBINED IMAGE -> start') -local upyun_upload = require("lib.upyun_upload") -ngx.say('UPLOAD COMBINED IMAGE -> upyun_upload loaded') - ---local fullpath = "/Users/liyong/Code/AlchemyStudio/resty_functions/test_files_dir/r2d2.jpeg"; -local fullpath = "/Users/liyong/Code/AlchemyStudio/resty_functions/test_files_dir/e4938956-954f-4918-be7f-7b10278a9ca4.jpeg"; - -ngx.say('UPLOAD COMBINED IMAGE -> fullpath -> ', fullpath) - -upyun_upload.upload(fullpath, nil) \ No newline at end of file