hostLowerは廃止してhostにlowerしたものを入れるように

This commit is contained in:
syuilo
2018-04-14 14:39:07 +09:00
parent 26c979bcec
commit d81c20f163
9 changed files with 10 additions and 16 deletions

View File

@ -1,5 +1,5 @@
import { toUnicode } from 'punycode';
export default host => {
return toUnicode(host).replace(/[A-Z]+/, match => match.toLowerCase());
return toUnicode(host).toLowerCase();
};

View File

@ -65,7 +65,7 @@ module.exports = (params, me) => new Promise(async (res, rej) => {
const q = userId !== undefined
? { _id: userId }
: { usernameLower: username.toLowerCase(), hostLower: getHostLower(host) } ;
: { usernameLower: username.toLowerCase(), host: getHostLower(host) } ;
// Lookup user
const user = await User.findOne(q, {

View File

@ -118,7 +118,6 @@ export default async (ctx: Koa.Context) => {
username: username,
usernameLower: username.toLowerCase(),
host: null,
hostLower: null,
keypair: generateKeypair(),
token: secret,
email: null,