We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dab66fc + fb11f3f commit a8343a8Copy full SHA for a8343a8
src/api/integrations/event/websocket/websocket.controller.ts
@@ -30,8 +30,12 @@ export class WebsocketController extends EventController implements EventControl
30
const url = new URL(req.url || '', 'http://localhost');
31
const params = new URLSearchParams(url.search);
32
33
+ const { remoteAddress } = req.socket;
34
+ const isLocalhost =
35
+ remoteAddress === '127.0.0.1' || remoteAddress === '::1' || remoteAddress === '::ffff:127.0.0.1';
36
+
37
// Permite conexões internas do Socket.IO (EIO=4 é o Engine.IO v4)
- if (params.has('EIO')) {
38
+ if (params.has('EIO') && isLocalhost) {
39
return callback(null, true);
40
}
41
0 commit comments