Skip to content

Commit

Permalink
Merge pull request #52 from CybercentreCanada/hotfix/empty_file_on_retry
Browse files Browse the repository at this point in the history
(Hotfix) Empty file on Retries
  • Loading branch information
cccs-sgaron committed Jul 8, 2024
2 parents 35708e1 + 1c077cd commit 79bc427
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assemblyline_client/v4_client/module/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __call__(self, fh=None, path=None, content=None, url=None, sha256=None, fnam
else:
raise ClientError('Could not guess the file name, please provide an fname parameter', 400)
fh.seek(0)
files = {'bin': (fname, fh)}
files = {'bin': fh}
request = {
'name': fname,
}
Expand Down
2 changes: 1 addition & 1 deletion assemblyline_client/v4_client/module/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __call__(self, fh=None, path=None, content=None, url=None, sha256=None, fnam
else:
raise ClientError('Could not guess the file name, please provide an fname parameter', 400)
fh.seek(0)
files = {'bin': (fname, fh)}
files = {'bin': fh}
request = {
'name': fname,
}
Expand Down
8 changes: 4 additions & 4 deletions test/test_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def test_submit_dynamic(datastore, client):
assert res['sid'] is not None
assert res == datastore.submission.get(res['sid'], as_obj=False)
assert 'Dynamic Analysis' in res['params']['services']['selected']
for k in res['params']:
for k, v in submission_data['params'].items():
if k not in ['submitter', 'services', 'description', 'quota_item']:
assert res['params'][k] == submission_data['params'][k]
assert res['params'].get(k) == v


def test_resubmit(datastore, client):
Expand All @@ -117,6 +117,6 @@ def test_resubmit(datastore, client):
assert res is not None
assert res['sid'] is not None
assert res == datastore.submission.get(res['sid'], as_obj=False)
for k in res['params']:
for k, v in submission_data['params'].items():
if k not in ['submitter', 'description', 'quota_item']:
assert res['params'][k] == submission_data['params'][k]
assert res['params'].get(k) == v

0 comments on commit 79bc427

Please sign in to comment.