fix: diable cors for websocket

This commit is contained in:
morteza-mortezai
2025-10-09 12:56:22 +03:30
parent a3e4a6bae3
commit 0a940e3b3a
+7 -6
View File
@@ -19,12 +19,13 @@ export class ChatGateway {
this.io = new Server(server, { this.io = new Server(server, {
path: "/ws-chat", path: "/ws-chat",
// addTrailingSlash: false, // addTrailingSlash: false,
cors: { // cors: {
origin: true, // origin: true,
allowedHeaders: ["Authorization"], // allowedHeaders: ["Authorization"],
credentials: true, // credentials: true,
methods: ["GET", "POST"], // methods: ["GET", "POST"],
}, // },
cors: { origin: "*" },
}); });
this.io.on("connection", (socket: Socket) => this.handleConnection(socket)); this.io.on("connection", (socket: Socket) => this.handleConnection(socket));
return this.io; return this.io;