ドメインは常にPunycodeで保存するように
This commit is contained in:
parent
4d64fd665e
commit
33a9783ae5
11 changed files with 31 additions and 29 deletions
|
@ -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}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue