mapbox / mapbox-sdk-js

A JavaScript client to Mapbox services, supporting Node, browsers, and React Native
Other
719 stars 186 forks source link

set body to empty string #479

Closed mapsam closed 8 months ago

mapsam commented 8 months ago

A POST, PUT, PATCH, or DELETE request using got that does not have a body defined will result in a socket timeout as described in #459. This updates the node-interface to set the body to an empty string if none is provided for the relevant methods.

Resolves #459

Refs: https://github.com/sindresorhus/got/issues/2303

I've added a regression test that will result in a timeout if the body is not set properly - here's how it looks prior to the change:

Screen Shot 2024-03-11 at 4 09 18 PM