到達不可能なホストを入力したときにエラーを出すように
This commit is contained in:
parent
84d25077b5
commit
4cfe4993a1
1 changed files with 5 additions and 0 deletions
|
@ -24,6 +24,11 @@ router.get('/login', async ctx => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const meta = await api<{ name: string, uri: string, version: string, features: Record<string, boolean | undefined> }>(host, 'meta', {});
|
const meta = await api<{ name: string, uri: string, version: string, features: Record<string, boolean | undefined> }>(host, 'meta', {});
|
||||||
|
if (typeof meta !== 'object') {
|
||||||
|
await die(ctx, 'other');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (meta.version.includes('hitori')) {
|
if (meta.version.includes('hitori')) {
|
||||||
await die(ctx, 'hitorisskeyIsDenied');
|
await die(ctx, 'hitorisskeyIsDenied');
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue