diff --git a/src/slic3r/GUI/Downloader.cpp b/src/slic3r/GUI/Downloader.cpp index 529230df5b..7a3a631ea4 100644 --- a/src/slic3r/GUI/Downloader.cpp +++ b/src/slic3r/GUI/Downloader.cpp @@ -66,11 +66,11 @@ void open_folder(const std::string& path) std::string filename_from_url(const std::string& url) { - // TODO: can it be done with curl? - size_t slash = url.find_last_of("/"); - if (slash == std::string::npos && slash != url.size() - 1) + std::string url_plain = std::string(url.begin(), std::find(url.begin(), url.end(), '?')); + size_t slash = url_plain.find_last_of("/"); + if (slash == std::string::npos) return std::string(); - return url.substr(slash + 1, url.size() - slash + 1); + return std::string(url_plain.begin() + slash + 1, url_plain.end()); } }