From 1c4067e7daeb4c3b7cc226d9d576e8cf29c1141f Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Mon, 3 Feb 2025 19:34:00 -0500 Subject: [PATCH] Do not cache empty response data --- playlet-lib/src/source/services/HttpClient.bs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/playlet-lib/src/source/services/HttpClient.bs b/playlet-lib/src/source/services/HttpClient.bs index 68fe4dc4..915157f1 100644 --- a/playlet-lib/src/source/services/HttpClient.bs +++ b/playlet-lib/src/source/services/HttpClient.bs @@ -842,6 +842,11 @@ namespace HttpClientCache return end if + body = ValidString(response.Text()) + if body = "" + return + end if + date = CreateObject("roDateTime") timestamp = date.AsSeconds() @@ -857,7 +862,6 @@ namespace HttpClientCache ' {body} ' the body as is, string size matching metadata.body jsonHeaders = FormatJson(response.Headers()) - body = ValidString(response.Text()) cacheMetadata = { timestamp: timestamp