From 47ae533319b463a162d9e17f95e1ae978ef8de64 Mon Sep 17 00:00:00 2001 From: Peter Hagen Date: Thu, 29 Feb 2024 15:43:10 +0100 Subject: [PATCH] Allow redirects --- apps/api/src/crawler/routes.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/src/crawler/routes.ts b/apps/api/src/crawler/routes.ts index 094f16c..4d6febd 100644 --- a/apps/api/src/crawler/routes.ts +++ b/apps/api/src/crawler/routes.ts @@ -66,9 +66,10 @@ router.addHandler("document", async ({ $, request, log, enqueueLinks }) => { const originalUrl = normalizeUrl(request.url); const originalDomain = getDomain(originalUrl); + const originalPathname = new URL(originalUrl).pathname; // Detect post type - const postType = getPostType(pathname); + const postType = getPostType(pathname) || getPostType(originalPathname); if (!postType) { log.info(`${domain} ${pathname} skipped (not /about, /now, or /ideas)\n`); return;