Commit 6b79f71
CRITICAL: WinHTTP POST missing Content-Type header (PSP payment fix)
Linux libcurl automatically sets Content-Type:
application/x-www-form-urlencoded when CURLOPT_POSTFIELDS is used.
Our WinHTTP stub did not. The PSP keepalive endpoint at
ipfs.digiassetx.com is an Express server using body-parser, which
SILENTLY DROPS the request body when no Content-Type header is
present.
So our keepalive POSTs were arriving with empty bodies — no
address, no peerId, no secret. The server saw an empty request
and returned "unsubscribe failed will time out anyways" (its
generic error for malformed/empty registrations).
Linux users with libcurl get paid because their POSTs include
the auto-set Content-Type header. Windows users on this port
got nothing because our minimal WinHTTP stub didn't replicate
this behavior.
Fix: in CurlHandler::post, add Content-Type:
application/x-www-form-urlencoded automatically when posting
form data, matching libcurl's behavior. Skip if user already
set a Content-Type header explicitly.
This affects ALL HTTP POSTs from the Windows build, not just PSP.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 239be65 commit 6b79f71
2 files changed
Lines changed: 19 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | 383 | | |
388 | 384 | | |
389 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
267 | 282 | | |
268 | 283 | | |
269 | 284 | | |
| |||
0 commit comments