mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-05 05:00:38 +08:00
fix(v1/map): handle invalid URLs gracefully
This commit is contained in:
parent
e19f7a102e
commit
ad1a6fbc74
@ -88,7 +88,13 @@ export async function mapController(
|
||||
links = performCosineSimilarity(links, searchQuery);
|
||||
}
|
||||
|
||||
links = links.map((x) => checkAndUpdateURLForMap(x).url.trim());
|
||||
links = links.map((x) => {
|
||||
try {
|
||||
return checkAndUpdateURLForMap(x).url.trim()
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
}).filter(x => x !== null);
|
||||
|
||||
// allows for subdomains to be included
|
||||
links = links.filter((x) => isSameDomain(x, req.body.url));
|
||||
|
Loading…
x
Reference in New Issue
Block a user