Pusher federation

Source: https://gist.github.com/jstsmthrgk/2c82124c9ac2bd453658f52c90b8dd44
This commit is contained in:
PizZaKatZe 2022-01-04 14:43:45 +01:00 committed by Ludwig Behm
parent f1c999ffc1
commit 185d3b58ed
5 changed files with 33 additions and 10 deletions

View file

@ -195,7 +195,11 @@ export class IoSocketController {
const websocketExtensions = req.getHeader("sec-websocket-extensions");
const IPAddress = req.getHeader("x-forwarded-for");
const roomId = query.roomId;
const roomId =
typeof query.roomId != "string"
? query.roomId
: "https://dummy.fediventure.net/_/global" +
query.roomId.replace(new RegExp("[^_]*_/[^/]*/"), "/");
try {
if (typeof roomId !== "string") {
throw new Error("Undefined room ID: ");