From fd637bf6bede43756abd33ec84593b3091d1283d Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 4 Sep 2022 10:01:57 +0100 Subject: mod_http_file_share: Use correct variable name (thanks riau.sni) --- plugins/mod_http_file_share.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua index 7c615757..c45e7732 100644 --- a/plugins/mod_http_file_share.lua +++ b/plugins/mod_http_file_share.lua @@ -264,11 +264,11 @@ function handle_upload(event, path) -- PUT /upload/:slot module:log("debug", "Unauthorized or invalid token: %s, %q", authz, authed_upload_info); return 401; end - if not path or upload_info.slot ~= path:match("^[^/]+") then - module:log("debug", "Invalid upload slot: %q, path: %q", upload_info.slot, path); + if not path or authed_upload_info.slot ~= path:match("^[^/]+") then + module:log("debug", "Invalid upload slot: %q, path: %q", authed_upload_info.slot, path); return 400; end - if request.headers.content_length and tonumber(request.headers.content_length) ~= upload_info.filesize then + if request.headers.content_length and tonumber(request.headers.content_length) ~= authed_upload_info.filesize then return 413; -- Note: We don't know the size if the upload is streamed in chunked encoding, -- so we also check the final file size on completion. -- cgit v1.2.3