From f3ae410567d949d83787627a51d0eb72b1eb2297 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Tue, 9 Jan 2018 12:16:45 +0000 Subject: [PATCH] fix some browser bugs --- src/core/runtime/dns-browser.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/runtime/dns-browser.js b/src/core/runtime/dns-browser.js index 26cf106ee0..adfe926886 100644 --- a/src/core/runtime/dns-browser.js +++ b/src/core/runtime/dns-browser.js @@ -10,11 +10,13 @@ module.exports = (domain, opts, callback) => { window.fetch(url, {mode: 'cors'}) .then((response) => { - const resp = response.json() - if (resp.Path) { - return callback(null, resp.Path) + return response.json() + }) + .then((response) => { + if (response.Path) { + return callback(null, response.Path) } else { - return callback(new Error(resp.Message)) + return callback(new Error(response.Message)) } }) .catch((error) => {