Skip to content

Commit 4608b45

Browse files
committed
fix: bypass sockjs requests
1 parent 2a164a9 commit 4608b45

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/proxy/routes-engine/rules/customRoutes.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,18 @@ describe("customRoutes()", () => {
311311
expect(regex).toBe(true);
312312
});
313313

314+
it("should not match root wildcards /* when requesting socketjs (for legacy config file)", async () => {
315+
req.url = "/sockjs-node/366/fskzyskg/websocket";
316+
userConfig = [
317+
{
318+
route: "/*",
319+
},
320+
];
321+
322+
const regex = matchRoute(req, res, true)(userConfig[0]);
323+
expect(regex).toBe(false);
324+
});
325+
314326
it("should not match root wildcards /* when requesting /.auth (for legacy config file)", async () => {
315327
req.url = "/.auth/login/github?post_login_redirect_uri=/profile";
316328
userConfig = [

src/proxy/routes-engine/rules/customRoutes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export const matchRoute = (req: http.IncomingMessage, _res: http.ServerResponse,
2323
return false;
2424
} else if (originlUrl.includes(".") && !originlUrl.startsWith("/.auth")) {
2525
return false;
26+
} else if (originlUrl.includes("sockjs")) {
27+
return false;
2628
}
2729
}
2830

0 commit comments

Comments
 (0)