From 9530de722d3c49d5d011b32039ac33c4343a3231 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Sun, 2 Aug 2026 16:25:58 +0200 Subject: [PATCH] =?UTF-8?q?ci:=20the=20alarm=20needs=20a=20User-Agent=20?= =?UTF-8?q?=E2=80=94=20Cloudflare=20403s=20python-urllib?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resend sits behind Cloudflare, which blocks the default 'Python-urllib/3.x' agent with its own 403 (error 1010). That failure looks exactly like an auth failure and is not one, so the reason is recorded next to the header. Verified from the runner image with a deliberately invalid payload: with the agent set, Resend answers 422 missing-field, i.e. the request now reaches the API. --- .gitea/workflows/gates.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/gates.yml b/.gitea/workflows/gates.yml index b158f14..86a27e7 100644 --- a/.gitea/workflows/gates.yml +++ b/.gitea/workflows/gates.yml @@ -84,7 +84,11 @@ jobs: req = urllib.request.Request( "https://api.resend.com/emails", data=body, method="POST", headers={"Authorization": "Bearer %s" % key, - "Content-Type": "application/json"}) + "Content-Type": "application/json", + # Cloudflare fronts api.resend.com and BLOCKS the default + # "Python-urllib/3.x" agent with its own 403 (error 1010) — which looks + # exactly like an auth failure and is not one. Measured 2026-08-02. + "User-Agent": "felhom-ci/1.0"}) try: with urllib.request.urlopen(req, timeout=30) as r: print("RESEND-ACCEPTED id=%s" % json.load(r)["id"])