mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 01:25:39 +00:00
f5207ba9c7
Summary: We currently handle empty body poorly in the iOS blob implementation, this happens because of an early return that cause the blob response to not be processed by the blob module, resulting in an empty string as the body instead of a blob object. We also need to make sure to create an empty blob object when data is nil (empty body) as per the XMLHttpRequest spec. The Android implementation was already handling this properly. Fixes #18223 Send a HEAD request ```js fetch('https://apipre.monkimun.com/whoami', { body: null, method: 'HEAD', headers: { Accept: 'application/json', 'Content-Type': 'application/json', }, }) ``` [IOS][BUGFIX][Blob] - Fix blob response parsing for empty body Closes https://github.com/facebook/react-native/pull/18547 Differential Revision: D7415950 Pulled By: hramos fbshipit-source-id: 56860532c6171255869f02a0960f55d155184a46