ドメインは常にPunycodeで保存するように

This commit is contained in:
syuilo
2019-04-09 23:59:32 +09:00
parent 4d64fd665e
commit 33a9783ae5
11 changed files with 31 additions and 29 deletions

View File

@ -2,10 +2,13 @@ import { Instance } from '../models/entities/instance';
import { Instances } from '../models';
import { federationChart } from './chart';
import { genId } from '../misc/gen-id';
import { toPuny } from '../misc/convert-host';
export async function registerOrFetchInstanceDoc(host: string): Promise<Instance> {
if (host == null) return null;
host = toPuny(host);
const index = await Instances.findOne({ host });
if (index == null) {