From a903647eb1200efb8357a1a2bb039d5b72942bde Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Sun, 22 Mar 2020 01:59:19 +1300 Subject: [PATCH] Fix instances API and user import script --- scripts/import_users.js | 2 +- src/site/api/instances.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/import_users.js b/scripts/import_users.js index 84abd3a..ad1c84e 100644 --- a/scripts/import_users.js +++ b/scripts/import_users.js @@ -10,7 +10,7 @@ const {request} = require("../src/lib/utils/request") process.exit(1) } if (target.match(/^https?:\/\//)) { - var usersString = await request(target).then(res => res.text()) + var usersString = await request(target).text() } else { var usersString = await fs.readFile(target, {encoding: "utf8"}) } diff --git a/src/site/api/instances.js b/src/site/api/instances.js index b8c8ec2..07aa607 100644 --- a/src/site/api/instances.js +++ b/src/site/api/instances.js @@ -9,7 +9,7 @@ module.exports = [ { route: "/api/instances", methods: ["GET"], code: () => { return instanceListCache.getOrFetch("instances", () => { - return request(constants.resources.instances_wiki_raw).then(res => res.text()).then(text => { + return request(constants.resources.instances_wiki_raw).text().then(text => { const result = (() => { const instances = [] const parser = new Parser(text)