Skip to content

Update got to v16 - #665

Merged
aivus merged 2 commits into
masterfrom
got-16
Oct 19, 2026
Merged

aivus merged 2 commits into
masterfrom
got-16

Conversation

@aivus

@aivus aivus commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Replaces #661.

got 15 and 16 have breaking changes that affect the scraper, so the dependabot bump alone fails 60 tests:

  • url is no longer allowed in the options object. getRequest now calls got(url, options). A url in user request options now makes got throw (see MIGRATION.md).
  • responseType: 'buffer' returns a Uint8Array instead of a Buffer. transformResult checked instanceof Buffer and threw "Wrong response handler result". The response body is now converted to a Buffer (without copying) before it goes to afterResponse, so user handlers keep getting a Buffer. transformResult also accepts any Uint8Array.

MIGRATION.md has a new v6 → v7 section covering the Node 22 requirement and the got changes users can see through options.request: strictContentLength on by default, 300/304 no longer followed, removed options, HTTP/2 and DNS cache changes, and credentials stripped on cross-origin redirects from hooks.

Tests: 248 passing, including new tests for a Uint8Array body and for afterResponse receiving a Buffer.

🤖 Generated with Claude Code

@aivus
aivus requested a review from s0ph1e October 19, 2026 20:13
aivus and others added 2 commits October 19, 2026 22:27
got 15+ returns Uint8Array for responseType 'buffer' and doesn't allow url
in options object. Pass url as first argument and convert response body to
Buffer so afterResponse handlers keep receiving Buffer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aivus
aivus merged commit 097b600 into master Oct 19, 2026
12 checks passed
@aivus
aivus deleted the got-16 branch October 19, 2026 20:29
aivus added a commit that referenced this pull request Oct 19, 2026
Resolve conflicts with the got v16 update (#665):
- pass url to got.stream separately, v16 no longer allows url in options
- accept Uint8Array body from afterResponse
- drop master's transformResult tests, the function no longer exists
- combine both "From version 6 to 7" migration sections

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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