From 9dba916b2d308efc13182670c6c135f530b29b58 Mon Sep 17 00:00:00 2001 From: zskbot <241179063+zskbot@users.noreply.github.com> Date: Tue, 17 Nov 2026 04:36:27 +0700 Subject: [PATCH 1/2] debug: capture safe HTTP 403 response metadata --- scripts/check-control-api-staging.mjs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/check-control-api-staging.mjs b/scripts/check-control-api-staging.mjs index bb94e8e..311c2dd 100644 --- a/scripts/check-control-api-staging.mjs +++ b/scripts/check-control-api-staging.mjs @@ -8,7 +8,21 @@ async function request(path, init = {}) { signal: AbortSignal.timeout(10_000), ...init }); - if (!response.ok) throw new Error(path + " returned HTTP " + response.status); + if (!response.ok) { + const body = (await response.text()).replace(/\\s+/g, " ").slice(0, 360); + const location = response.headers.get("location"); + const safeLocation = location ? (() => { try { const u = new URL(location); return u.origin + u.pathname; } catch { return "present"; } })() : null; + throw new Error(JSON.stringify({ + path, + status: response.status, + finalUrl: new URL(response.url).origin + new URL(response.url).pathname, + server: response.headers.get("server"), + cfMitigated: response.headers.get("cf-mitigated"), + contentType: response.headers.get("content-type"), + location: safeLocation, + body + })); + } return response; } From 89d98142b5269d32210be47710d965aef8fa2cb1 Mon Sep 17 00:00:00 2001 From: zskbot <241179063+zskbot@users.noreply.github.com> Date: Tue, 17 Nov 2026 04:37:13 +0700 Subject: [PATCH 2/2] test: use staging Worker workers.dev origin for CI smoke test --- scripts/check-control-api-staging.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check-control-api-staging.mjs b/scripts/check-control-api-staging.mjs index 311c2dd..a1b9dda 100644 --- a/scripts/check-control-api-staging.mjs +++ b/scripts/check-control-api-staging.mjs @@ -1,4 +1,4 @@ -const BASE = (process.env.CONTROL_API_BASE || "https://api-staging.ocodejs.co/api/v1").replace(/\/$/, ""); +const BASE = (process.env.CONTROL_API_BASE || "https://ocodejs-server-api-staging.huynhthuongg2505-f9b.workers.dev/api/v1").replace(/\/$/, ""); const ORIGIN = "https://ocodejs.co"; const MAX_AGE_MS = 60_000;