Skip to content

Commit

Permalink
Fix for missing API key
Browse files Browse the repository at this point in the history
  • Loading branch information
phutelmyer committed Mar 29, 2024
1 parent 773c11e commit c4873a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions app/blueprints/strelka.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ def submit_file(
file_hash=submitted_hash,
)

# Assume file is a BytesIO object and set a filename attribute
file.filename = submitted_hash

except Exception as e:
return (
jsonify(
Expand All @@ -189,9 +192,16 @@ def submit_file(
),
400,
)

# Assume file is a BytesIO object and set a filename attribute
file.filename = submitted_hash
else:
return (
jsonify(
{
"error": "VirusTotal request was not successful.",
"details": "No VirusTotal API key has been loaded. Check the README for details.",
}
),
400,
)

# Submit the file to the Strelka analysis engine.
if file:
Expand Down
2 changes: 1 addition & 1 deletion app/services/virustotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def create_vt_zip_and_download(api_key, file_hash, password, max_attempts=3):
Args:
api_key (str): The API key for VirusTotal.
file_hash (str): The hash of the file to download.
file_hash (list): The hash of the file to download.
password (str): The password to set for the ZIP file.
max_attempts (int): The maximum number of attempts to check for ZIP readiness.
Expand Down

0 comments on commit c4873a1

Please sign in to comment.