From 57a62ad7bc1032beccbf69efb45485dfa97dfe92 Mon Sep 17 00:00:00 2001 From: Roman Alifanov Date: Thu, 22 Mar 2018 13:29:36 +0100 Subject: [PATCH] Fixed [0.54 - iOS] fetch HEAD requests fail with `Invalid response for blob` --- Libraries/Network/XMLHttpRequest.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Libraries/Network/XMLHttpRequest.js b/Libraries/Network/XMLHttpRequest.js index d17001d3743f34..527de858cf9814 100644 --- a/Libraries/Network/XMLHttpRequest.js +++ b/Libraries/Network/XMLHttpRequest.js @@ -254,7 +254,11 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) { if (typeof this._response === 'object' && this._response) { this._cachedResponse = BlobManager.createFromOptions(this._response); } else { - throw new Error(`Invalid response for blob: ${this._response}`); + if (this._response === '') { + this._cachedResponse = null; + } else { + throw new Error(`Invalid response for blob: ${this._response}`); + } } break;