sindresorhus / got

🌐 Human-friendly and powerful HTTP request library for Node.js
MIT License
14.27k stars 935 forks source link

`promise.json()` throws when options haven't been normalized yet #1438

Closed szmarczak closed 4 years ago

szmarczak commented 4 years ago

Describe the bug

The faulty part: https://github.com/sindresorhus/got/compare/v11.5.2...v11.6.0#diff-6be2971b2bb8dbf48d15ff680dd898b0R191

Actual behavior

Cannot destructure property 'headers' of 'globalRequest.options' as it is undefined

Expected behavior

No error.

Code to reproduce

See https://github.com/DrewML/chrome-webstore-upload/issues/41

Checklist

szmarczak commented 4 years ago

Fixed in c97ce7cbde86f7cc40bd646dfc660811050a8376