mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2026-03-22 07:29:35 +08:00
fix: url sanitization
This commit is contained in:
@@ -24,6 +24,9 @@ export function normalizeUrl(urlString: string, debug = false, options = {
|
||||
}
|
||||
|
||||
const url = new URL(urlString);
|
||||
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
||||
throw new Error('Unsupported protocol');
|
||||
}
|
||||
|
||||
url.hostname = url.hostname.toLowerCase();
|
||||
if (url.hostname.startsWith('www.')) {
|
||||
|
||||
Reference in New Issue
Block a user