Changeset

5699: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 5698:17ea26cf7259
children 5700:a5089978928a
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 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