diff mod_storage_s3/mod_storage_s3.lua @ 5676:799f69a5921a

mod_storage_s3: Treat 404 to GET as a signal for empty data
author Kim Alvefur <zash@zash.se>
date Sat, 14 Oct 2023 22:50:29 +0200
parents 17ea26cf7259
children b4632d5f840b
line wrap: on
line diff
--- a/mod_storage_s3/mod_storage_s3.lua	Sat Oct 14 22:49:57 2023 +0200
+++ b/mod_storage_s3/mod_storage_s3.lua	Sat Oct 14 22:50:29 2023 +0200
@@ -117,6 +117,9 @@
 
 -- coerce result back into Prosody data type
 local function on_result(response)
+	if response.code == 404 and response.request.method == "GET" then
+		return nil;
+	end
 	if response.code >= 400 then
 		error(response.body);
 	end