fix: websocket path check

This commit is contained in:
Anton Voylenko 2024-12-23 10:16:19 +02:00
commit cc79ecd2c5

View file

@ -54,7 +54,7 @@ const triggerWebSocket = (sessionId, dataType, data) => {
const handleUpgrade = (request, socket, head) => {
const baseUrl = 'ws://' + request.headers.host + '/'
const { pathname } = new URL(request.url, baseUrl)
if (pathname.startsWith('/ws')) {
if (pathname.startsWith('/ws/')) {
const sessionId = pathname.split('/')[2]
const server = wssMap.get(sessionId)
if (server) {