Skip to content

Send a User-Agent from the HTTP client (fixes Dev.to edge 403) - #9

Merged
DanMat merged 1 commit into
mainfrom
fix/http-user-agent
Sep 7, 2026
Merged

DanMat merged 1 commit into
mainfrom
fix/http-user-agent

Conversation

@DanMat

@DanMat DanMat commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Root cause

The plugin's CurlHttpClient set no User-Agent. PHP's curl sends none by default, and Dev.to's edge (Varnish) answers a no-UA request with an empty-bodied HTTP 403 before it ever reaches the Forem API. That is what was failing every blog_syndicate_post (external_id null every time), and why the error carried no upstream text (the empty body was the edge's, not Forem's).

Proven server-side against GET /api/users/me with the live key, from the danmat container:

UA=(none / PHP default)  -> 403   server: Varnish   body: (empty)
UA=curl/8.0              -> 200   server: Heroku    body: {"id":4111350,"username":"danmat"...}
UA=NimbusCMS-Blog/1.0    -> 200   server: Heroku    ...

Not the SVG (outbound body is clean markdown), not the key (valid, correct account), not a publish gate (a manual publish did not help, because the request never reached the API).

Fix

CurlHttpClient now sends a descriptive User-Agent (NimbusCMS-Blog/1.0, overridable). This also benefits Hashnode, which shares the client.
🤖 Generated with Claude Code

PHP's curl sends no User-Agent by default, and Dev.to's edge (Varnish) answers
a no-UA request with an empty-bodied HTTP 403 before it reaches the Forem API.
That, not the post body, was failing every syndication: proven server-side, the
same GET returns 403 with no UA and 200 with any UA. CurlHttpClient now sends a
descriptive User-Agent (overridable), which also benefits Hashnode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DanMat
DanMat merged commit 58765c2 into main Sep 7, 2026
2 checks passed
@DanMat
DanMat deleted the fix/http-user-agent branch September 7, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant