Skip to content

Commit

Permalink
Fix websocket url query params (1.3.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanPlayz0 committed Mar 26, 2024
1 parent c1e7dfe commit f9f234c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export class Server<Context extends {}, Methods extends LocalRouteMethods<Contex
});
this.server = server;
server.on('upgrade', (request, socket, head) => {
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;
Expand Down

0 comments on commit f9f234c

Please sign in to comment.