Skip to content

Commit efbbad4

Browse files
committed
fix: [domain search] check if onion is valid before sending to spider
1 parent 67e915a commit efbbad4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

var/www/blueprints/crawler_splash.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ def domain_discovery():
224224
user_org = current_user.get_org()
225225
user_id = current_user.get_user_id()
226226
domain = request.args.get('domain')
227+
if not crawlers.is_valid_onion_domain(domain):
228+
return create_json_response({'status': 'error', 'reason': 'Invalid onion domain'}, 400)
229+
227230
data = {'depth': 1, 'har': True, 'screenshot': True, 'url': f'http://{domain}', 'proxy': 'force_tor'}
228231
res = crawlers.api_add_crawler_task(data, user_org, user_id=user_id)
229232

0 commit comments

Comments
 (0)