diff --git a/app/server.ts b/app/server.ts index 4935f0b..de270ee 100644 --- a/app/server.ts +++ b/app/server.ts @@ -1,6 +1,5 @@ import "./src/bootstrap/async-local-storage-polyfill"; import { createServer } from "node:http"; -import { parse } from "node:url"; import next from "next"; import { WebSocketServer } from "ws"; import { getConfig } from "./src/lib/config/load"; @@ -25,14 +24,14 @@ const handle = app.getRequestHandler(); app.prepare().then(() => { const httpServer = createServer((req, res) => { - handle(req, res, parse(req.url ?? "/", true)); + handle(req, res); }); const wss = new WebSocketServer({ noServer: true }); attachWsServer(wss); httpServer.on("upgrade", (req, socket, head) => { - const { pathname } = parse(req.url ?? "/"); + const { pathname } = new URL(req.url ?? "/", "http://internal"); if (pathname !== "/ws/runs") { socket.destroy(); return;