From 4a02f7456385b1dd37cb1882894ff099f9664662 Mon Sep 17 00:00:00 2001 From: John Livingston Date: Fri, 21 Apr 2023 18:49:15 +0200 Subject: [PATCH] Fix cross domain BOSH. --- server/lib/routers/webchat.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server/lib/routers/webchat.ts b/server/lib/routers/webchat.ts index ccbfe898..a29bdb74 100644 --- a/server/lib/routers/webchat.ts +++ b/server/lib/routers/webchat.ts @@ -216,6 +216,22 @@ async function initWebchatRouter (options: RegisterServerOptionsV5): Promise { + try { + if (!currentHttpBindProxy) { + res.status(404) + res.send('Not found') + return + } + req.url = 'http-bind' + currentHttpBindProxy.web(req, res) + } catch (err) { + next(err) + } + } + ) // Peertube >=5.0.0: Adding the websocket route. if (registerWebSocketRoute) {