ci: the alarm needs a User-Agent — Cloudflare 403s python-urllib
gates / gates (push) Failing after 8s
gates / gates (push) Failing after 8s
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.
This commit is contained in:
@@ -84,7 +84,11 @@ jobs:
|
|||||||
req = urllib.request.Request(
|
req = urllib.request.Request(
|
||||||
"https://api.resend.com/emails", data=body, method="POST",
|
"https://api.resend.com/emails", data=body, method="POST",
|
||||||
headers={"Authorization": "Bearer %s" % key,
|
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:
|
try:
|
||||||
with urllib.request.urlopen(req, timeout=30) as r:
|
with urllib.request.urlopen(req, timeout=30) as r:
|
||||||
print("RESEND-ACCEPTED id=%s" % json.load(r)["id"])
|
print("RESEND-ACCEPTED id=%s" % json.load(r)["id"])
|
||||||
|
|||||||
Reference in New Issue
Block a user