From 896681d5b919f76877237f796ec204069be73981 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sun, 15 Jan 2023 00:47:11 +0000 Subject: [PATCH] fix: remove duckduckgo from crawler list --- plugins/social.server.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/social.server.ts b/plugins/social.server.ts index 5c215b96..bae26169 100644 --- a/plugins/social.server.ts +++ b/plugins/social.server.ts @@ -10,7 +10,9 @@ export default defineNuxtPlugin(async (nuxtApp) => { if (!userAgent) return - const isOpenGraphCrawler = /twitterbot|discordbot|facebookexternalhit|googlebot|msnbot|baidu|ahrefsbot|duckduckgo/i.test(userAgent) - if (isOpenGraphCrawler) + const isOpenGraphCrawler = /twitterbot|discordbot|facebookexternalhit|googlebot|msnbot|baidu|ahrefsbot/i.test(userAgent) + if (isOpenGraphCrawler) { + // Redirect bots to the original instance to respect their social sharing settings await sendRedirect(nuxtApp.ssrContext!.event, `https:/${route.path}`, 301) + } })