Log if password needed url encoding

This commit is contained in:
David Baker
2023-10-09 16:28:48 +01:00
parent 0892edc432
commit 6faceb07cd

View File

@@ -401,11 +401,14 @@ export function getRelativeRoomUrl(
): string { ): string {
// The password shouldn't need URL encoding here (we generate URL-safe ones) but encode // The password shouldn't need URL encoding here (we generate URL-safe ones) but encode
// it in case it came from another client that generated a non url-safe one // it in case it came from another client that generated a non url-safe one
const encodedPassword = password ? encodeURIComponent(password) : undefined;
if (password && encodedPassword !== password) {
logger.info("Encoded call password used non URL-safe chars: buggy client?");
}
return `/room/#${ return `/room/#${
roomName ? "/" + roomAliasLocalpartFromRoomName(roomName) : "" roomName ? "/" + roomAliasLocalpartFromRoomName(roomName) : ""
}?roomId=${roomId}${ }?roomId=${roomId}${password ? "&" + PASSWORD_STRING + encodedPassword : ""}`;
password ? "&" + PASSWORD_STRING + encodeURIComponent(password) : ""
}`;
} }
export function getAvatarUrl( export function getAvatarUrl(