# HG changeset patch # User Matthew Wild # Date 1662282117 -3600 # Node ID cd993fd7b60d553a2be5246a87be560a1f8a1464 # Parent 7830db3c38c3d9c5752e2dd2c365f1254b5f46f1 mod_http_file_share: Use correct variable name (thanks riau.sni) diff -r 7830db3c38c3 -r cd993fd7b60d plugins/mod_http_file_share.lua --- a/plugins/mod_http_file_share.lua Sat Sep 03 21:25:51 2022 +0100 +++ b/plugins/mod_http_file_share.lua Sun Sep 04 10:01:57 2022 +0100 @@ -264,11 +264,11 @@ 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.