diff --git a/lib/grid-register.js b/lib/grid-register.js index 33db7230b..275b5f19a 100644 --- a/lib/grid-register.js +++ b/lib/grid-register.js @@ -66,7 +66,8 @@ async function postRequest (data, addr, port) { url: `http://${jsonObject.configuration.hubHost}:${jsonObject.configuration.hubPort}/grid/register`, method: 'POST', body: data, - headers: post_headers + headers: post_headers, + resolveWithFullResponse: true // return the full response, not just the body }; if (jsonObject.configuration.register !== true) { @@ -101,7 +102,8 @@ async function isAlreadyRegistered (jsonObject) { let response = await request({ uri: `http://${jsonObject.configuration.hubHost}:${jsonObject.configuration.hubPort}/grid/api/proxy?id=${id}`, method : 'GET', - timeout : 10000 + timeout : 10000, + resolveWithFullResponse: true // return the full response, not just the body }); if (response === undefined || response.statusCode !== 200) { throw new Error(`Request failed`);