5 Commits
Author SHA1 Message Date
dualfroz 3cd9bf211f Describe this repository 2026-10-22 21:07:03 +02:00
dualfroz 017b847750 fix: retry refused connections on Node.js 24.20+
Since Node.js 24.20 (nodejs/node#64847) the ClientRequest end() callback
fires with the connection error after the request has already emitted
error and been destroyed. That late ERR_SOCKET_CLOSED_BEFORE_CONNECTION was
forwarded to _final, destroying the stream and cancelling the retry that the
error handler had scheduled, so ECONNREFUSED was no longer retried and the
generic error surfaced instead of the real one.

Ignore the end() callback error once the request is destroyed; the real
error already drives the retry state machine. Write errors like EPIPE that
arrive while the request is still alive keep reaching the retry classifier.

Fixes #2469
2026-08-28 03:35:54 +02:00
upstream 6c46990d75 Upstream sindresorhus/got state of the touched files before 38cc6be0cc 2026-08-28 03:35:54 +02:00
dualfroz 3ce94ca09d fix: retry immediately on non-positive numeric Retry-After header
The numeric Retry-After branch multiplied the header value by 1000 without
guarding non-positive results, so `Retry-After: 0` produced a falsy delay
that fell through to exponential backoff instead of retrying immediately.
The RFC-1123 date branch already clamps non-positive values to 1ms; mirror
that guard in the numeric branch so a non-positive Retry-After retries at
once.
2026-08-27 23:36:28 +02:00
upstream 7eb9032cf2 Upstream sindresorhus/got state of the touched files before 2904797b6d 2026-08-27 23:36:28 +02:00