summaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-04-09 23:59:32 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-04-09 23:59:32 +0900
commit33a9783ae5cf18e913cfe3f0223ed89aa94e63b4 (patch)
tree6eae0a7d9791876eff8c7bac4fb3dcdd0679a8bf /src/config
parentUpdate update.ts (diff)
downloadmisskey-33a9783ae5cf18e913cfe3f0223ed89aa94e63b4.tar.gz
misskey-33a9783ae5cf18e913cfe3f0223ed89aa94e63b4.tar.bz2
misskey-33a9783ae5cf18e913cfe3f0223ed89aa94e63b4.zip
ドメインは常にPunycodeで保存するように
Diffstat (limited to 'src/config')
-rw-r--r--src/config/load.ts7
1 files changed, 4 insertions, 3 deletions
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}`;