Skip to content
This repository was archived by the owner on Jul 17, 2024. It is now read-only.

Commit 3f2678e

Browse files
authored
chore: update socketManager
1 parent 0c9e549 commit 3f2678e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/managers/socketManager.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@ export function init() {
2424
serveClient: false,
2525
allowEIO3: true,
2626
allowRequest: (req, callback) => {
27-
const noOriginHeader = req.headers.origin === undefined;
28-
callback(null, noOriginHeader);
27+
if (req.headers.origin === undefined) return callback(null, true);
28+
//* 2.5.0+ only allows extensions to connect
29+
if (
30+
req.headers.origin.startsWith("chrome-extension://") ||
31+
req.headers.origin.startsWith("moz-extension://")
32+
)
33+
return callback(null, true);
34+
35+
callback("Origin not allowed", false);
2936
}
3037
});
3138
server.listen(3020, () => {

0 commit comments

Comments
 (0)