fedimbed: fix mastodon fallback try 2

This commit is contained in:
Cynthia Foxwell 2022-12-05 21:13:47 -07:00
parent 9d924813f3
commit 643cfa4501
1 changed files with 2 additions and 2 deletions

View File

@ -115,8 +115,8 @@ async function processUrl(msg, url) {
let redirUrl;
if (PATH_REGEX.pleroma2.test(urlObj.pathname)) {
redirUrl = url.replace("notice", "api/v1/statuses");
} else if (PATH_REGEX.mastodon.test(urlObj.pathName)) {
redirUrl = url.replace(/@(.+?)\/(\d+)\/?/, "api/v1/statuses/$2");
} else if (PATH_REGEX.mastodon.test(urlObj.pathname)) {
redirUrl = url.replace(/@(.+?)\//, "api/v1/statuses/");
} else {
logger.error(
"fedimbed",