Commit 5c1cd20
authored
fix: Disable connection keepalive when using
Disable HTTP connection keepalive when using `node-fetch` to fetch the
registry as it may fail with newer Node versions, when the content is
gzipped.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Single-header change to build-time HTTP behavior only; no runtime app
logic, auth, or data model changes.
>
> **Overview**
> Adds **`Connection: close`** to the shared `HEADERS` object in
`gatsby-node.ts` so every **`node-fetch`** call during the Gatsby build
(registry, signature, cached registry, and stats) closes the TCP
connection instead of reusing keep-alive pools.
>
> This targets intermittent **registry fetch failures on newer Node
versions** when persistent connections are left open.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
33e9924. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->node-fetch (#643)1 parent de7b9e1 commit 5c1cd20
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
0 commit comments