diff options
author | Kim Alvefur <zash@zash.se> | 2021-01-27 17:48:12 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-01-27 17:48:12 +0100 |
commit | 17a85e6d3b542eff9e433098c469c57e2c02c30f (patch) | |
tree | e30d82abf60176694c9b86e741e83c9c1c90d1fc /plugins/mod_http_file_share.lua | |
parent | e4a97b8e7adc69cce1d3583139d55ff92eec24cd (diff) | |
download | prosody-17a85e6d3b542eff9e433098c469c57e2c02c30f.tar.gz prosody-17a85e6d3b542eff9e433098c469c57e2c02c30f.zip |
mod_http_file_share: Use '.bin' file extension
Distinct from '.dat' used by datamanager / internal stortage for Lua
object storage so that they can't easily be loaded by accident that way.
Diffstat (limited to 'plugins/mod_http_file_share.lua')
-rw-r--r-- | plugins/mod_http_file_share.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua index 25efdaa8..55af15a1 100644 --- a/plugins/mod_http_file_share.lua +++ b/plugins/mod_http_file_share.lua @@ -171,7 +171,8 @@ function handle_upload(event, path) -- PUT /upload/:slot -- so we also check the final file size on completion. end - local filename = dm.getpath(upload_info.slot, module.host, module.name, nil, true); + local filename = dm.getpath(upload_info.slot, module.host, module.name, "bin", true); + if not request.body_sink then module:log("debug", "Preparing to receive upload into %q, expecting %s", filename, B(upload_info.filesize)); @@ -228,7 +229,7 @@ function handle_download(event, path) -- GET /uploads/:slot+filename if request.headers.if_modified_since == last_modified then return 304; end - local filename = dm.getpath(slot_id, module.host, module.name); + local filename = dm.getpath(slot_id, module.host, module.name, "bin"); local handle, ferr = errors.coerce(io.open(filename)); if not handle then return ferr or 410; |