fedimbed: trim urls

This commit is contained in:
Cynthia Foxwell 2022-12-29 11:18:22 -07:00
parent 370f6a882a
commit 1d541bf122

View file

@ -493,7 +493,8 @@ events.add("messageCreate", "fedimbed", async function (msg) {
if (URLS_REGEX.test(msg.content)) { if (URLS_REGEX.test(msg.content)) {
const urls = msg.content.match(URLS_REGEX); const urls = msg.content.match(URLS_REGEX);
for (const url of urls) { for (let url of urls) {
url = url.trim();
for (const service of Object.keys(PATH_REGEX)) { for (const service of Object.keys(PATH_REGEX)) {
const regex = PATH_REGEX[service]; const regex = PATH_REGEX[service];
const urlObj = new URL(url); const urlObj = new URL(url);