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

Commit f3ae410

Browse files
committed
fix some browser bugs
1 parent 52fc4d7 commit f3ae410

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/core/runtime/dns-browser.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ module.exports = (domain, opts, callback) => {
1010

1111
window.fetch(url, {mode: 'cors'})
1212
.then((response) => {
13-
const resp = response.json()
14-
if (resp.Path) {
15-
return callback(null, resp.Path)
13+
return response.json()
14+
})
15+
.then((response) => {
16+
if (response.Path) {
17+
return callback(null, response.Path)
1618
} else {
17-
return callback(new Error(resp.Message))
19+
return callback(new Error(response.Message))
1820
}
1921
})
2022
.catch((error) => {

0 commit comments

Comments
 (0)