Skip to content

Commit 38be0b4

Browse files
Merge pull request #2280 from micaelmz/feature/wildcard-for-websocket-allowed-hosts
feat: add wildcard "*" to allow all hosts to connect via websocket
2 parents 3864366 + abd0351 commit 38be0b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/api/integrations/event/websocket/websocket.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export class WebsocketController extends EventController implements EventControl
3333
const { remoteAddress } = req.socket;
3434
const websocketConfig = configService.get<Websocket>('WEBSOCKET');
3535
const allowedHosts = websocketConfig.ALLOWED_HOSTS || '127.0.0.1,::1,::ffff:127.0.0.1';
36-
const isAllowedHost = allowedHosts
36+
const allowAllHosts = allowedHosts.trim() === '*';
37+
const isAllowedHost = allowAllHosts || allowedHosts
3738
.split(',')
3839
.map((h) => h.trim())
3940
.includes(remoteAddress);

0 commit comments

Comments
 (0)