mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
allow whitespaces for duet upload
* now url_encoding characters which could not used for URLs
This commit is contained in:
parent
22569de00f
commit
e1417f1827
3 changed files with 19 additions and 3 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <boost/log/trivial.hpp>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
|
||||
#include <wx/frame.h>
|
||||
#include <wx/event.h>
|
||||
|
@ -197,7 +198,7 @@ std::string Duet::get_upload_url(const std::string &filename) const
|
|||
{
|
||||
return (boost::format("%1%rr_upload?name=0:/gcodes/%2%&%3%")
|
||||
% get_base_url()
|
||||
% filename
|
||||
% Http::url_encode(filename)
|
||||
% timestamp_str()).str();
|
||||
}
|
||||
|
||||
|
@ -248,9 +249,10 @@ wxString Duet::format_error(const std::string &body, const std::string &error, u
|
|||
bool Duet::start_print(wxString &msg, const std::string &filename) const
|
||||
{
|
||||
bool res = false;
|
||||
|
||||
auto url = (boost::format("%1%rr_gcode?gcode=M32%%20\"%2%\"")
|
||||
% get_base_url()
|
||||
% filename).str();
|
||||
% Http::url_encode(filename)).str();
|
||||
|
||||
auto http = Http::get(std::move(url));
|
||||
http.on_error([&](std::string body, std::string error, unsigned status) {
|
||||
|
@ -275,5 +277,4 @@ int Duet::get_err_code_from_body(const std::string &body) const
|
|||
return root.get<int>("err", 0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue