react-native/Libraries/Blob
Janic Duplessis 093a78d99d Fix blob response parsing for empty body on iOS
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
2018-03-28 19:12:09 +02:00
..
RCTBlob.xcodeproj Implement Blob support for XMLHttpRequest 2018-01-26 09:17:11 -08:00
__mocks__ Update license headers for MIT license 2018-02-16 18:31:53 -08:00
__tests__ Adding tests to cover regressions when upgrading to babel 7 2018-03-06 02:16:12 -08:00
Blob.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
BlobManager.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
BlobRegistry.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
BlobTypes.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
File.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
FileReader.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTBlobManager.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTBlobManager.mm Fix blob response parsing for empty body on iOS 2018-03-28 19:12:09 +02:00
RCTFileReaderModule.h Update license headers for MIT license 2018-02-16 18:31:53 -08:00
RCTFileReaderModule.m Update license headers for MIT license 2018-02-16 18:31:53 -08:00
URL.js Update license headers for MIT license 2018-02-16 18:31:53 -08:00