MCPcopy
hub / github.com/WebODM/WebODM / get

Method get

app/api/tasks.py:668–683  ·  view source on GitHub ↗

Downloads a task asset (if available)

(self, request, pk=None, project_pk=None, unsafe_asset_path="")

Source from the content-addressed store, hash-verified

666"""
667class TaskAssets(TaskNestedView):
668 def get(self, request, pk=None, project_pk=None, unsafe_asset_path=""):
669 """
670 Downloads a task asset (if available)
671 """
672 task = self.get_and_check_task(request, pk)
673
674 # Check for directory traversal attacks
675 try:
676 asset_path = path_traversal_check(task.assets_path(unsafe_asset_path), task.assets_path(""))
677 except SuspiciousFileOperation:
678 raise exceptions.NotFound(_("Asset does not exist"))
679
680 if (not os.path.exists(asset_path)) or os.path.isdir(asset_path):
681 raise exceptions.NotFound(_("Asset does not exist"))
682
683 return download_file_response(request, asset_path, 'inline')
684
685"""
686Task backup endpoint

Callers 15

set_pending_actionMethod · 0.45
outputMethod · 0.45
listMethod · 0.45
retrieveMethod · 0.45
commitMethod · 0.45
uploadMethod · 0.45
duplicateMethod · 0.45
createMethod · 0.45
updateMethod · 0.45
get_and_check_taskMethod · 0.45
download_file_responseFunction · 0.45

Calls 6

path_traversal_checkFunction · 0.90
download_file_responseFunction · 0.85
get_and_check_taskMethod · 0.80
assets_pathMethod · 0.80
existsMethod · 0.80
_Function · 0.50

Tested by

no test coverage detected