mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-01 07:01:59 +08:00
fix(crawl): send error if url is not a string
Fixes FIRECRAWL-SCRAPER-JS-1E and FIRECRAWL-SCRAPER-JS-Z
This commit is contained in:
parent
0cdf41587e
commit
14fa75cae6
@ -72,6 +72,9 @@ export async function crawlController(req: Request, res: Response) {
|
||||
if (!url) {
|
||||
return res.status(400).json({ error: "Url is required" });
|
||||
}
|
||||
if (typeof url !== "string") {
|
||||
return res.status(400).json({ error: "URL must be a string" });
|
||||
}
|
||||
try {
|
||||
url = checkAndUpdateURL(url).url;
|
||||
} catch (e) {
|
||||
@ -87,8 +90,6 @@ export async function crawlController(req: Request, res: Response) {
|
||||
});
|
||||
}
|
||||
|
||||
const mode = req.body.mode ?? "crawl";
|
||||
|
||||
// if (mode === "single_urls" && !url.includes(",")) { // NOTE: do we need this?
|
||||
// try {
|
||||
// const a = new WebScraperDataProvider();
|
||||
|
Loading…
x
Reference in New Issue
Block a user