Fix instances API and user import script

This commit is contained in:
Cadence Ember 2020-03-22 01:59:19 +13:00
parent f3014e3fc6
commit a903647eb1
No known key found for this signature in database
GPG Key ID: 81015DF9AA8607E1
2 changed files with 2 additions and 2 deletions

View File

@ -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"})
}

View File

@ -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)