We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b837949 commit e08293bCopy full SHA for e08293b
packages/engine.io/lib/server.ts
@@ -1,5 +1,3 @@
1
-import * as qs from "querystring";
2
-import { parse } from "url";
3
import * as base64id from "base64id";
4
import transports from "./transports";
5
import { EventEmitter } from "events";
@@ -736,9 +734,8 @@ export class Server extends BaseServer {
736
734
private prepare(req: EngineRequest) {
737
735
// try to leverage pre-existing `req._query` (e.g: from connect)
738
if (!req._query) {
739
- req._query = (
740
- ~req.url.indexOf("?") ? qs.parse(parse(req.url).query) : {}
741
- ) as Record<string, string>;
+ const url = new URL(req.url, "https://socket.io");
+ req._query = Object.fromEntries(url.searchParams.entries());
742
}
743
744
0 commit comments