changeset 5674:51d0311747fa

mod_storage_s3: Handle archive query without parameters
author Kim Alvefur <zash@zash.se>
date Sat, 14 Oct 2023 22:49:12 +0200
parents b17ba149b7c5
children 17ea26cf7259
files mod_storage_s3/mod_storage_s3.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_storage_s3/mod_storage_s3.lua	Sat Oct 14 21:44:14 2023 +0200
+++ b/mod_storage_s3/mod_storage_s3.lua	Sat Oct 14 22:49:12 2023 +0200
@@ -218,6 +218,9 @@
 	local bucket_path = url.build_path({ is_absolute = true; bucket; is_directory = true });
 	local prefix = { jid.escape(module.host); jid.escape(self.store); is_directory = true };
 	table.insert(prefix, jid.escape(username or "@"));
+	if not query then
+		query = {};
+	end
 	if query["with"] then
 		table.insert(prefix, sha256(jid.prep(query["with"]), true):sub(1,24));
 		if query["start"] and query["end"] and dt.date(query["start"]) == dt.date(query["end"]) then