Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix some browser bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Jan 9, 2018
1 parent 52fc4d7 commit f3ae410
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/runtime/dns-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit f3ae410

Please sign in to comment.