cloudflare_status_bot

Log | Files | Refs | README | LICENSE

commit 6a508e4f8c86da6f03f6decb6846f4cf8080bd4e
parent d1fcbd5233d416e631cc7136b15ae41a1622b4a8
Author: William Lindholm <85635561+LindholmLabs@users.noreply.github.com>
Date:   Thu, 24 Sep 2026 15:54:23 +0000

Fixed status check

Diffstat:
Mstatus-bot/src/index.js | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/status-bot/src/index.js b/status-bot/src/index.js @@ -38,8 +38,11 @@ function parseUrlsFromEnv() { async function responseIsOk(url) { try { - const response = await fetch(url); - return "<span style='color:green;'>online</span>"; + const response = await fetch(url, { redirect: "follow" }); + if (response.status < 500) { + return "<span style='color:green;'>online</span>"; + } + return "<span style='color:red;'>offline</span>"; } catch { return "<span style='color:red;'>offline</span>"; }