Fix depricated URL parser

This commit is contained in:
2026-04-02 20:46:56 +02:00
parent b74f11fb22
commit 8373ea1abe
+2 -3
View File
@@ -1,4 +1,3 @@
import { parse } from 'url';
import { VERSION_ERROR } from '../../common/errors'; import { VERSION_ERROR } from '../../common/errors';
import { IAccount, IOriginInfo, ICharacter, FindCharacter, HasActiveSupporterInvites } from '../db'; import { IAccount, IOriginInfo, ICharacter, FindCharacter, HasActiveSupporterInvites } from '../db';
import { UserError } from '../userError'; import { UserError } from '../userError';
@@ -43,8 +42,8 @@ export const createJoinGame =
if (clientVersion !== version) if (clientVersion !== version)
throw new UserError(VERSION_ERROR); throw new UserError(VERSION_ERROR);
if (parse(url).host !== parse(host).host && !debug && !local) if (new URL(url).host !== new URL(host).host && !debug && !local)
throw new UserError('Invalid data', { message: 'Invalid host', desc: url }); throw new UserError('Invalid data', { message: 'Invalid host', desc: url });
if (!server) if (!server)
throw new UserError('Invalid data'); throw new UserError('Invalid data');