mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 21:55:52 +02:00
Fix depricated URL parser
This commit is contained in:
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user