mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-06 02:06:05 +08:00
fix(v1): proper Invalid URL handling
This commit is contained in:
parent
2cbc4c59ce
commit
26f2095de6
@ -30,7 +30,14 @@ export const url = z.preprocess(
|
||||
"URL must have a valid top-level domain or be a valid path"
|
||||
)
|
||||
.refine(
|
||||
(x) => checkUrl(x as string),
|
||||
(x) => {
|
||||
try {
|
||||
checkUrl(x as string)
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
"Invalid URL"
|
||||
)
|
||||
.refine(
|
||||
|
Loading…
x
Reference in New Issue
Block a user