Changeset

11324:494761f5d7da

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.
author Kim Alvefur <zash@zash.se>
date Wed, 27 Jan 2021 17:48:12 +0100
parents 11323:a853a018eede
children 11325:76fc73d39092
files plugins/mod_http_file_share.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_http_file_share.lua	Wed Jan 27 17:47:04 2021 +0100
+++ b/plugins/mod_http_file_share.lua	Wed Jan 27 17:48:12 2021 +0100
@@ -171,7 +171,8 @@
 		-- 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 @@
 	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;