Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

feat(api/crawl): support hash-based routing (#2031)

Gergő Móricz68cf062fb8d5
diff --git a/apps/api/src/lib/crawl-redis.ts b/apps/api/src/lib/crawl-redis.ts
index 77254bed0..00cd05b3b 100644
--- a/apps/api/src/lib/crawl-redis.ts
+++ b/apps/api/src/lib/crawl-redis.ts
@@ -235,7 +235,10 @@ export function normalizeURL(url: string, sc: StoredCrawl): string {
if (sc && sc.crawlerOptions && sc.crawlerOptions.ignoreQueryParameters) {
urlO.search = "";
}
- urlO.hash = "";
+ // allow hash-based routes
+ if (!urlO.hash || urlO.hash.length <= 2 || !urlO.hash.startsWith("#/")) {
+ urlO.hash = "";
+ }
return urlO.href;
}