npm got 16.1.0

4 hours ago

This release is the result of a large bug hunt. Many of the fixes make Got match its documented behavior, so you may notice some of them:

  • Invalid options now throw: an empty method, a negative or fractional maxRedirects or retry.limit, a prefixUrl with a query string or fragment, and a handlers entry that is not a function.
  • A stream with a body, json, or form option now rejects writes, as documented.
  • The promise response event now only fires for the final response, not for every retry attempt.
  • got.extend({body}) (and json, form) no longer sends the payload with every request of the instance. Payloads are never merged with defaults.
  • instance.extend() now inherits the parent's mutableDefaults, like got.extend(instance).
  • A HEAD request is no longer changed to GET on a 301, 302, or 303 redirect.
  • response.body no longer keeps a leading UTF-8 byte order mark, and JSON with a byte order mark now parses.

Improvements

  • Accept number values in headers 6fffc9e
  • Export the Timings, DnsCacheLookup, and DnsCacheOptions types d012d1d eccaaca
  • Retry FormData bodies by re-serializing them instead of failing 90c6ec1
  • Support the x-gzip content coding and stacked content codings 5550a79

Fixes


v16.0.0...v16.1.0

Don't miss a new got release

NewReleases is sending notifications on new releases.