summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-05 16:10:24 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-05 16:10:24 +1100
commitc47068b186439c8b00bb83e79d825527dad5b8ad (patch)
treea59ce7ec19b3aaba6d02df7653dc2e5c13302bd4 /src/api
parentCheck nonce in Message send (diff)
downloadserver-c47068b186439c8b00bb83e79d825527dad5b8ad.tar.xz
embed fail
Diffstat (limited to 'src/api')
-rw-r--r--src/api/util/handlers/Message.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts
index 68fd37de..37269185 100644
--- a/src/api/util/handlers/Message.ts
+++ b/src/api/util/handlers/Message.ts
@@ -194,7 +194,7 @@ export async function postHandleMessage(message: Message) {
 	for (const link of links) {
 		const url = new URL(link);
 
-		const cached = await EmbedCache.findOne({ where: { url: `${url.host}${url.pathname}` } });
+		const cached = await EmbedCache.findOne({ where: { url: link } });
 		if (cached) {
 			data.embeds.push(cached.embed);
 			continue;
@@ -212,7 +212,7 @@ export async function postHandleMessage(message: Message) {
 
 			for (var embed of res) {
 				var cache = EmbedCache.create({
-					url: `${url.host}${url.pathname}`,
+					url: link,
 					embed: embed,
 				});
 				cachePromises.push(cache.save());