From 61313ebc21a00e2a9a12266b95847f747940b619 Mon Sep 17 00:00:00 2001 From: Isaac Ouellet Therrien Date: Thu, 3 May 2018 10:56:10 -0400 Subject: [PATCH] Throw an error if user is using XMLHttpRequest Following changes from @jdalrymple in his `jobs-pipeline-endpoints` branch --- src/infrastructure/RequestHelper.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/infrastructure/RequestHelper.js b/src/infrastructure/RequestHelper.js index 1585e978..ee55c76d 100644 --- a/src/infrastructure/RequestHelper.js +++ b/src/infrastructure/RequestHelper.js @@ -32,6 +32,9 @@ function defaultRequest( class RequestHelper { static async get(service, endpoint, options = {}, requestOptions = {}) { if (requestOptions && requestOptions.stream === true) { + if (service.useXMLHttpRequest) { + throw new Error('Cannot use streaming functionality with XMLHttpRequest. Please instantiate without this option to use streaming'); + } return StreamableRequest.get(defaultRequest(service, endpoint, { headers: service.headers, qs: options,