diff --git a/src/web/routes/link.js b/src/web/routes/link.js index ef96ea9..b46b78f 100644 --- a/src/web/routes/link.js +++ b/src/web/routes/link.js @@ -17,8 +17,12 @@ const {reg} = require("../../matrix/read-registration") * @returns {string} the HS of the user, or "" if the user ID is malformed */ function getHSOfUser(user) { - /* c8 ignore next */ - return user.partition(":")[2] + domainStartIndex = user.indexOf(":"); + if (domainStartIndex >= 1) { + return user.slice(domainStartIndex + 1) + } + + return "" }