File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/api/integrations/event/websocket Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,14 @@ export class WebsocketController extends EventController implements EventControl
2828 allowRequest : async ( req , callback ) => {
2929 try {
3030 const url = new URL ( req . url || '' , 'http://localhost' ) ;
31- const isInternalConnection = req . socket . remoteAddress === '127.0.0.1' || req . socket . remoteAddress === '::1' ;
3231 const params = new URLSearchParams ( url . search ) ;
3332
33+ const remoteAddress = req . socket . remoteAddress ;
34+ const isLocalhost =
35+ remoteAddress === '127.0.0.1' || remoteAddress === '::1' || remoteAddress === '::ffff:127.0.0.1' ;
36+
3437 // Permite conexões internas do Socket.IO (EIO=4 é o Engine.IO v4)
35- if ( params . has ( 'EIO' ) && isInternalConnection ) {
38+ if ( params . has ( 'EIO' ) && isLocalhost ) {
3639 return callback ( null , true ) ;
3740 }
3841
You can’t perform that action at this time.
0 commit comments