mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-08-15 11:25:54 +08:00
fix: explicitly reject non http protocols
This commit is contained in:
parent
abc817e960
commit
d4ca381c38
@ -195,6 +195,12 @@ ${this.content}
|
||||
let urlToCrawl;
|
||||
try {
|
||||
urlToCrawl = new URL(normalizeUrl(noSlashURL.trim(), { stripWWW: false, removeTrailingSlash: false, removeSingleSlash: false }));
|
||||
if (urlToCrawl.protocol !== 'http:' && urlToCrawl.protocol !== 'https:') {
|
||||
throw new ParamValidationError({
|
||||
message: `Invalid protocol ${urlToCrawl.protocol}`,
|
||||
path: 'url'
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
throw new ParamValidationError({
|
||||
message: `${err}`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user