Update extract.ts

This commit is contained in:
Nicolas 2024-11-14 15:41:42 -05:00
parent 22848af5ae
commit 91f4fd815f

View File

@ -44,7 +44,7 @@ export async function extractController(
// Process all URLs in parallel
const urlPromises = req.body.urls.map(async (url) => {
if (url.includes('/*')) {
if (url.includes('/*') || req.body.allowExternalLinks) {
// Handle glob pattern URLs
const baseUrl = url.replace('/*', '');
const pathPrefix = baseUrl.split('/').slice(3).join('/'); // Get path after domain if any