From 21a10705f12adecdb127c6e8be3da42c28191d71 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Tue, 6 May 2025 17:05:01 -0400 Subject: [PATCH] Handle unauthorized case in backend --- .../PlayletInvidiousBackendRouter.bs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayletInvidiousBackendRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayletInvidiousBackendRouter.bs index f5f68095..76b041ad 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayletInvidiousBackendRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayletInvidiousBackendRouter.bs @@ -80,6 +80,15 @@ namespace Http return true end if + if IsAssociativeArray(feeds) + if feeds.error <> invalid + response.Json(feeds) + response.http_code = 500 + return true + end if + return true + end if + result = { "videos": [] } @@ -144,6 +153,15 @@ namespace Http return true end if + if IsAssociativeArray(feeds) + if feeds.error <> invalid + response.Json(feeds) + response.http_code = 500 + return true + end if + return true + end if + if feeds.Count() > 0 response.Json(feeds[0]) return true @@ -186,6 +204,15 @@ namespace Http return true end if + if IsAssociativeArray(feeds) + if feeds.error <> invalid + response.Json(feeds) + response.http_code = 500 + return true + end if + return true + end if + if feeds.Count() > 0 response.Json(feeds[0]) return true