From 8373ea1abe3327619cdd2c6ee967c34bdf99652e Mon Sep 17 00:00:00 2001 From: Terncode Date: Thu, 2 Apr 2026 20:46:56 +0200 Subject: [PATCH] Fix depricated URL parser --- src/ts/server/api/game.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ts/server/api/game.ts b/src/ts/server/api/game.ts index e2f4b9c..25ce16c 100644 --- a/src/ts/server/api/game.ts +++ b/src/ts/server/api/game.ts @@ -1,4 +1,3 @@ -import { parse } from 'url'; import { VERSION_ERROR } from '../../common/errors'; import { IAccount, IOriginInfo, ICharacter, FindCharacter, HasActiveSupporterInvites } from '../db'; import { UserError } from '../userError'; @@ -43,8 +42,8 @@ export const createJoinGame = if (clientVersion !== version) throw new UserError(VERSION_ERROR); - if (parse(url).host !== parse(host).host && !debug && !local) - throw new UserError('Invalid data', { message: 'Invalid host', desc: url }); + if (new URL(url).host !== new URL(host).host && !debug && !local) + throw new UserError('Invalid data', { message: 'Invalid host', desc: url }); if (!server) throw new UserError('Invalid data');