diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2018-11-11 13:11:16 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2018-11-11 13:11:16 +0900 |
| commit | 16136c252a8ec63f9cd89130c19bb5eddec91d27 (patch) | |
| tree | 18c1b1f22e32a015f8847251e5afa902a96c4e0a /src/remote/resolve-user.ts | |
| parent | Fix #3190 (diff) | |
| download | sharkey-16136c252a8ec63f9cd89130c19bb5eddec91d27.tar.gz sharkey-16136c252a8ec63f9cd89130c19bb5eddec91d27.tar.bz2 sharkey-16136c252a8ec63f9cd89130c19bb5eddec91d27.zip | |
fix self host detection (#3201)
Diffstat (limited to 'src/remote/resolve-user.ts')
| -rw-r--r-- | src/remote/resolve-user.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/remote/resolve-user.ts b/src/remote/resolve-user.ts index ed259774bd..26ca6d024f 100644 --- a/src/remote/resolve-user.ts +++ b/src/remote/resolve-user.ts @@ -16,10 +16,13 @@ export default async (username: string, _host: string, option?: any, resync?: bo return await User.findOne({ usernameLower, host: null }); } + const configHostAscii = toASCII(config.host).toLowerCase(); + const configHost = toUnicode(configHostAscii); + const hostAscii = toASCII(_host).toLowerCase(); const host = toUnicode(hostAscii); - if (config.host == host) { + if (configHost == host) { log(`return local user: ${usernameLower}`); return await User.findOne({ usernameLower, host: null }); } |