update remove request body

This commit is contained in:
XiaoLi
2024-01-07 21:17:04 +08:00
committed by XiaoLi
parent 6743af945b
commit a964335e54
3 changed files with 9 additions and 5 deletions
+2 -1
View File
@@ -34,7 +34,8 @@ function upyun_remove.remove(filepath, filename, retry)
local bucket = ngx.var.upyun_bucket
local directory = ngx.var.upyun_directory
if not filename then
filename = strip_path.strip_path(filepath)
--filename = strip_path.strip_path(filepath)
filename = filepath
end
ngx.log(ngx.INFO, 'bucket -> ', bucket)
+2 -2
View File
@@ -53,6 +53,6 @@ local function upyun_remove_file()
end
--upyun_upload_file()
upyun_upload_file()
upyun_remove_file()
--upyun_remove_file()
+5 -2
View File
@@ -11,7 +11,8 @@ local sudoerToken = ngx.req.get_headers().HtySudoerToken
ngx.req.read_body()
local request_body = ngx.req.get_body_data()
local request_body_json = cjson.decode(request_body)
local upyun_remove_url = request_body_json["request_url"]
--local upyun_remove_url = request_body_json["request_url"]
local upyun_remove_url = request_body_json["filename"]
ngx.log(ngx.INFO, 'upyun_remove_url -> ', upyun_remove_url)
verify(httpc, authHeader, sudoerToken)
@@ -20,7 +21,9 @@ ngx.log(ngx.INFO, 'REMOVE UPYUN FILE -> start')
local upyun_upload = require("lib.upyun_remove")
ngx.log(ngx.INFO, 'REMOVE UPYUN FILE -> upyun_remove loaded')
local file_to_remove = string.match(upyun_remove_url, ".*/(.*)")
--local file_to_remove = string.match(upyun_remove_url, ".*/(.*)")
--local file_to_remove = string.match(upyun_remove_url, ".+/([^/]+)$")
local file_to_remove = upyun_remove_url
ngx.log(ngx.INFO, 'REMOVE UPYUN FILE -> file to remove -> ', file_to_remove)
--local file_dir = ngx.var.tmp_file_dir