mirror of
https://github.com/akuker/RASCSI.git
synced 2024-05-29 01:41:27 +00:00
Web UI: Better handling of upload destination dir checks (#1076)
Web UI: Better handling of upload destination dir checks
This commit is contained in:
parent
538887b805
commit
8823dfba7d
|
@ -980,11 +980,14 @@ def upload_file():
|
||||||
return make_response(auth["msg"], 403)
|
return make_response(auth["msg"], 403)
|
||||||
|
|
||||||
destination = request.form.get("destination")
|
destination = request.form.get("destination")
|
||||||
if destination == "file_server":
|
if destination == "disk_images":
|
||||||
destination_dir = FILE_SERVER_DIR
|
|
||||||
else:
|
|
||||||
server_info = piscsi_cmd.get_server_info()
|
server_info = piscsi_cmd.get_server_info()
|
||||||
destination_dir = server_info["image_dir"]
|
destination_dir = server_info["image_dir"]
|
||||||
|
elif destination == "shared_files":
|
||||||
|
destination_dir = FILE_SERVER_DIR
|
||||||
|
else:
|
||||||
|
return make_response(f"Invalid destination '{destination}'", 403)
|
||||||
|
|
||||||
return upload_with_dropzonejs(destination_dir)
|
return upload_with_dropzonejs(destination_dir)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -253,6 +253,7 @@ def test_upload_file(http_client, delete_file):
|
||||||
chunk_byte_offset = chunk_number * chunk_size
|
chunk_byte_offset = chunk_number * chunk_size
|
||||||
|
|
||||||
form_data = {
|
form_data = {
|
||||||
|
"destination": "disk_images",
|
||||||
"dzuuid": str(uuid.uuid4()),
|
"dzuuid": str(uuid.uuid4()),
|
||||||
"dzchunkindex": chunk_number,
|
"dzchunkindex": chunk_number,
|
||||||
"dzchunksize": chunk_size,
|
"dzchunksize": chunk_size,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user