Comparison

mod_storage_s3/mod_storage_s3.lua @ 5697:51d0311747fa

mod_storage_s3: Handle archive query without parameters
author Kim Alvefur <zash@zash.se>
date Sat, 14 Oct 2023 22:49:12 +0200
parent 5696:b17ba149b7c5
child 5698:17ea26cf7259
comparison
equal deleted inserted replaced
5696:b17ba149b7c5 5697:51d0311747fa
216 216
217 function archive:find(username, query) 217 function archive:find(username, query)
218 local bucket_path = url.build_path({ is_absolute = true; bucket; is_directory = true }); 218 local bucket_path = url.build_path({ is_absolute = true; bucket; is_directory = true });
219 local prefix = { jid.escape(module.host); jid.escape(self.store); is_directory = true }; 219 local prefix = { jid.escape(module.host); jid.escape(self.store); is_directory = true };
220 table.insert(prefix, jid.escape(username or "@")); 220 table.insert(prefix, jid.escape(username or "@"));
221 if not query then
222 query = {};
223 end
221 if query["with"] then 224 if query["with"] then
222 table.insert(prefix, sha256(jid.prep(query["with"]), true):sub(1,24)); 225 table.insert(prefix, sha256(jid.prep(query["with"]), true):sub(1,24));
223 if query["start"] and query["end"] and dt.date(query["start"]) == dt.date(query["end"]) then 226 if query["start"] and query["end"] and dt.date(query["start"]) == dt.date(query["end"]) then
224 table.insert(prefix, sha256(jid.prep(query["with"]), true):sub(1,24)); 227 table.insert(prefix, sha256(jid.prep(query["with"]), true):sub(1,24));
225 end 228 end