mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 17:27:52 -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
|
@ -421,6 +421,18 @@ bool Http::ca_file_supported()
|
|||
return res;
|
||||
}
|
||||
|
||||
std::string Http::url_encode(const std::string &str)
|
||||
{
|
||||
::CURL *curl = ::curl_easy_init();
|
||||
char *ce = ::curl_easy_escape(curl, str.c_str(), str.length());
|
||||
std::string encoded = std::string(ce);
|
||||
|
||||
::curl_free(ce);
|
||||
if (curl != nullptr) { ::curl_easy_cleanup(curl); }
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream &os, const Http::Progress &progress)
|
||||
{
|
||||
os << "Http::Progress("
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue