From f9f234c0db523442a9364c09ab24ba6a83376804 Mon Sep 17 00:00:00 2001 From: DanPlayz0 Date: Mon, 25 Mar 2024 19:04:41 -0700 Subject: [PATCH] Fix websocket url query params (1.3.2) --- package.json | 2 +- src/Server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e59dfa5..e12e4f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ashmwtech/dapir", - "version": "1.3.1", + "version": "1.3.2", "type": "module", "description": "An api wrapper", "source": "src/index.ts", diff --git a/src/Server.ts b/src/Server.ts index 899bdab..55dc965 100644 --- a/src/Server.ts +++ b/src/Server.ts @@ -260,7 +260,7 @@ export class Server { - if (this.config.websocket.enabled == false || this.config.websocket.path !== request.url) { + if (this.config.websocket.enabled == false || new URL(request.url!).host == this.config.websocket.path ) { socket.write('HTTP/1.1 404 Not Found\r\n\r\n'); socket.destroy(); return;