From b87f512b9e241aded71d88953222c21f73dc7b62 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 14 Sep 2021 16:17:17 +0200 Subject: [PATCH] SendSystemInfo: do not close the dialog when failed/cancelled, set content-type to json --- src/slic3r/GUI/SendSystemInfoDialog.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/SendSystemInfoDialog.cpp b/src/slic3r/GUI/SendSystemInfoDialog.cpp index 1e0ed69d2..f4fb50fd5 100644 --- a/src/slic3r/GUI/SendSystemInfoDialog.cpp +++ b/src/slic3r/GUI/SendSystemInfoDialog.cpp @@ -313,9 +313,10 @@ SendSystemInfoDialog::SendSystemInfoDialog(wxWindow* parent) m_btn_send->Bind(wxEVT_BUTTON, [this](const wxEvent&) { - if (send_info()) + if (send_info()) { save_version(); - EndModal(0); + EndModal(0); + } }); m_btn_dont_send->Bind(wxEVT_BUTTON, [this](const wxEvent&) { @@ -356,7 +357,8 @@ bool SendSystemInfoDialog::send_info() auto send = [&job_done, &result](const std::string& data) { const std::string url = "https://files.prusa3d.com/wp-json/v1/ps"; Http http = Http::post(url); - http.set_post_body(data) + http.header("Content-Type", "application/json") + .set_post_body(data) .on_complete([&result](std::string body, unsigned status) { result = { Result::Success, _L("System info sent successfully. Thank you.") }; })