From 33a9783ae5cf18e913cfe3f0223ed89aa94e63b4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 9 Apr 2019 23:59:32 +0900 Subject: ドメインは常にPunycodeで保存するように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/load.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/config') diff --git a/src/config/load.ts b/src/config/load.ts index 50ae47d9e2..4d174d0e27 100644 --- a/src/config/load.ts +++ b/src/config/load.ts @@ -7,6 +7,7 @@ import { URL } from 'url'; import * as yaml from 'js-yaml'; import { Source, Mixin } from './types'; import * as pkg from '../../package.json'; +import { toPuny } from '../misc/convert-host'; /** * Path of configuration directory @@ -27,12 +28,12 @@ export default function load() { const url = validateUrl(config.url); - config.url = normalizeUrl(config.url); + config.url = toPuny(normalizeUrl(config.url)); config.port = config.port || parseInt(process.env.PORT, 10); - mixin.host = url.host; - mixin.hostname = url.hostname; + mixin.host = toPuny(url.host); + mixin.hostname = toPuny(url.hostname); mixin.scheme = url.protocol.replace(/:$/, ''); mixin.wsScheme = mixin.scheme.replace('http', 'ws'); mixin.wsUrl = `${mixin.wsScheme}://${mixin.host}`; -- cgit v1.2.3-freya