From f9e36a08a8de53bf9618776cee9916496d73152e Mon Sep 17 00:00:00 2001 From: leeight Date: Tue, 25 Oct 2016 22:18:20 -0700 Subject: [PATCH] Make sure xhr req header's value is String type Summary: In the `NetworkingModule.java`, `header.getString(1)` was called, so the value must be String type. FIX #10198 Closes https://github.com/facebook/react-native/pull/10222 Differential Revision: D4080319 Pulled By: lacker fbshipit-source-id: 85234a2bbf90e5b9e0e65ceadbfabb330b2d1322 --- Libraries/Network/XMLHttpRequest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Network/XMLHttpRequest.js b/Libraries/Network/XMLHttpRequest.js index ef93632c7..edcaf4b5d 100644 --- a/Libraries/Network/XMLHttpRequest.js +++ b/Libraries/Network/XMLHttpRequest.js @@ -352,7 +352,7 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) { if (this.readyState !== this.OPENED) { throw new Error('Request has not been opened'); } - this._headers[header.toLowerCase()] = value; + this._headers[header.toLowerCase()] = String(value); } /**