Skip to content

Commit

Permalink
repurpose submitted_url_only to analyze_submitted_url
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-rs committed Aug 31, 2022
1 parent 797bac7 commit 085ebab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions urldownloader/urldownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ def execute(self, request: ServiceRequest) -> None:
if request.get_param('user_agent'):
headers['User-Agent'] = request.get_param('user_agent')

# Code to be used when responsibility of fetching submitted_url is moved to service from UI
# -----------------------------------------------------------------------------------------
urls = []
submitted_url = request.task.metadata.get('submitted_url')
# Make sure this is the first URL fetched
urls = [(submitted_url, 10000)] if submitted_url and request.task.depth == 0 else []
if request.get_param('analyze_submitted_url') and submitted_url and request.task.depth == 0:
# Make sure this is the first URL fetched
urls = [(submitted_url, 10000)]

tags = request.task.tags
# Distinguish between only fetching the submitted_url vs all in the submission
Expand All @@ -62,7 +62,7 @@ def execute(self, request: ServiceRequest) -> None:

request.temp_submission_data.setdefault('visited_urls', {})

# Check if current file is malicious, if so tag URL that downloaded the file
# Check if current file is malicious, if so tag URL that downloaded the file
task_score = 0
for tags_tuples in tags.values():
task_score += sum([tag_tuple[1] for tag_tuple in tags_tuples])
Expand Down

0 comments on commit 085ebab

Please sign in to comment.