Skip to content

Commit

Permalink
Updated client to use new file endpoint (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cx01N authored May 17, 2023
1 parent 79a9a5c commit c352619
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion empire/client/src/menus/InteractMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,14 +503,14 @@ def execute_shortcut(self, command_name: str, params: List[str]):
try:
file_directory = post_body.get("options")["File"]
filename = file_directory.split("/")[-1]
post_body.get("options")["File"] = filename
data = get_data_from_file(file_directory)
except Exception:
log.error("Invalid filename or file does not exist")
return
response = state.upload_file(filename, data)
if "id" in response.keys():
log.info("File uploaded to server successfully")
post_body.get("options")["File"] = response["id"]
elif "detail" in response.keys():
if response["detail"].startswith("[!]"):
msg = response["detail"]
Expand Down
2 changes: 1 addition & 1 deletion empire/client/src/menus/UseModuleMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ def execute(self):
try:
file_directory = self.record_options["File"]["value"]
filename = file_directory.split("/")[-1]
self.record_options["File"]["value"] = filename
data = get_data_from_file(file_directory)
except Exception:
log.error("Invalid filename or file does not exist")
return
response = state.upload_file(filename, data)
if "id" in response.keys():
log.info("File uploaded to server successfully")
self.record_options["File"]["value"] = response["id"]

elif "detail" in response.keys():
if response["detail"].startswith("[!]"):
Expand Down

0 comments on commit c352619

Please sign in to comment.