Skip to content

Commit

Permalink
Merge pull request #15 from CybercentreCanada/hotfix/update_tool_version
Browse files Browse the repository at this point in the history
Update session's service_tool_version from the results
  • Loading branch information
cccs-sgaron authored Jul 27, 2021
2 parents 526cb50 + 19d9fa7 commit f52810c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions assemblyline_service_client/task_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ def handle_task_result(self, result_json_path: str, task: ServiceTask):
result_files[file['sha256']] = copy.deepcopy(file)
file.pop('path', None)

new_tool_version = result.get('response', {}).get('service_tool_version', None)
if new_tool_version is not None and self.service_tool_version != new_tool_version:
self.service_tool_version = new_tool_version
self.session.headers.update({'service_tool_version': self.service_tool_version})

data = dict(task=task.as_primitives(), result=result, freshen=True)
try:
r = self.request_with_retries('post', self._path('task'), json=data)
Expand Down

0 comments on commit f52810c

Please sign in to comment.