Diff

mod_storage_s3/mod_storage_s3.lua @ 5751:80702e33ba71

mod_storage_s3: Fix storing archives for host itself (e.g. mod_audit) Fixes error due to path constructor trying to do string.gsub(nil) with missing username or with fields.
author Kim Alvefur <zash@zash.se>
date Wed, 22 Nov 2023 12:56:50 +0100
parent 5723:9de7a1b36efb
child 5755:e8938a3166d2
line wrap: on
line diff
--- a/mod_storage_s3/mod_storage_s3.lua	Wed Nov 22 11:54:22 2023 +0000
+++ b/mod_storage_s3/mod_storage_s3.lua	Wed Nov 22 12:56:50 2023 +0100
@@ -206,8 +206,8 @@
 		bucket;
 		jid.escape(module.host);
 		jid.escape(self.store);
-		jid.escape(username);
-		jid.escape(jid.prep(with));
+		jid.escape(username or "@");
+		jid.escape(with and jid.prep(with) or "@");
 		date or dt.date(when);
 		key;
 	})