mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-02 06:20:36 +08:00
Do not escape upload path in PrusaConnectNew init_upload
This commit is contained in:
parent
f6e8a1e898
commit
2de65cfa6a
@ -90,8 +90,8 @@ bool PrusaConnectNew::init_upload(PrintHostUpload upload_data, std::string& out)
|
||||
const std::string name = get_name();
|
||||
const std::string file_size = std::to_string(size);
|
||||
const std::string access_token = GUI::wxGetApp().plater()->get_user_account()->get_access_token();
|
||||
const std::string escaped_upload_path = escape_path_by_element(upload_data.upload_path);
|
||||
const std::string escaped_upload_filename = escape_path_by_element(upload_data.upload_path.filename());
|
||||
const std::string upload_path = upload_data.upload_path.generic_string();
|
||||
const std::string upload_filename = upload_data.upload_path.filename().string();
|
||||
std::string url = GUI::format("%1%/app/users/teams/%2%/uploads", get_host(), m_team_id);
|
||||
const std::string request_body_json = GUI::format(
|
||||
"{"
|
||||
@ -101,9 +101,9 @@ bool PrusaConnectNew::init_upload(PrintHostUpload upload_data, std::string& out)
|
||||
"\"force\": true, "
|
||||
"\"printer_uuid\": \"%4%\""
|
||||
"}"
|
||||
, escaped_upload_filename
|
||||
, upload_filename
|
||||
, file_size
|
||||
, upload_data.storage + "/" + escaped_upload_path
|
||||
, upload_data.storage + "/" + upload_path
|
||||
, m_uuid
|
||||
);
|
||||
|
||||
@ -156,7 +156,7 @@ bool PrusaConnectNew::upload(PrintHostUpload upload_data, ProgressFn progress_fn
|
||||
}
|
||||
const std::string name = get_name();
|
||||
const std::string access_token = GUI::wxGetApp().plater()->get_user_account()->get_access_token();
|
||||
const std::string escaped_upload_path = escape_string(upload_data.storage + "/" + upload_data.upload_path.string());
|
||||
const std::string escaped_upload_path = upload_data.storage + "/" + escape_path_by_element(upload_data.upload_path.string());
|
||||
const std::string to_print = upload_data.post_action == PrintHostPostUploadAction::StartPrint ? "true" : "false";
|
||||
const std::string to_queue = upload_data.post_action == PrintHostPostUploadAction::QueuePrint ? "true" : "false";
|
||||
std::string url = GUI::format("%1%/app/teams/%2%/files/raw?upload_id=%3%&force=true&printer_uuid=%4%&path=%5%&to_print=%6%&to_queue=%7%", get_host(), m_team_id, upload_id, m_uuid, escaped_upload_path, to_print, to_queue);
|
||||
|
Loading…
x
Reference in New Issue
Block a user