Skip to content

Commit

Permalink
Properly return a bluebird promise
Browse files Browse the repository at this point in the history
refs TryGhost#8980

- ☹️ apparently this is actually the only way
  • Loading branch information
ErisDS committed Sep 7, 2017
1 parent 6c216b8 commit 07300ae
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions core/server/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ module.exports = function request(url, options) {
}));
}

return got(
url,
options
).then(function (response) {
return Promise.resolve(response);
}).catch(function (err) {
return Promise.reject(err);
return new Promise(function (resolve, reject) {
return got(
url,
options
).then(function (response) {
return resolve(response);
}).catch(function (err) {
return reject(err);
});
});
};

0 comments on commit 07300ae

Please sign in to comment.