mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 08:55:58 +08:00
Accept-Language when getting PrusaLink storage
This commit is contained in:
parent
61b31bfbc3
commit
3700738123
@ -702,8 +702,12 @@ bool PrusaLink::get_storage(wxArrayString& storage_path, wxArrayString& storage_
|
|||||||
|
|
||||||
BOOST_LOG_TRIVIAL(info) << boost::format("%1%: Get storage at: %2%") % name % url;
|
BOOST_LOG_TRIVIAL(info) << boost::format("%1%: Get storage at: %2%") % name % url;
|
||||||
|
|
||||||
|
wxString wlang = GUI::wxGetApp().current_language_code();
|
||||||
|
std::string lang = GUI::format(wlang.SubString(0, 1));
|
||||||
|
|
||||||
auto http = Http::get(std::move(url));
|
auto http = Http::get(std::move(url));
|
||||||
set_auth(http);
|
set_auth(http);
|
||||||
|
http.header("Accept-Language", lang);
|
||||||
http.on_error([&](std::string body, std::string error, unsigned status) {
|
http.on_error([&](std::string body, std::string error, unsigned status) {
|
||||||
BOOST_LOG_TRIVIAL(error) << boost::format("%1%: Error getting storage: %2%, HTTP %3%, body: `%4%`") % name % error % status % body;
|
BOOST_LOG_TRIVIAL(error) << boost::format("%1%: Error getting storage: %2%, HTTP %3%, body: `%4%`") % name % error % status % body;
|
||||||
error_msg = L"\n\n" + boost::nowide::widen(error);
|
error_msg = L"\n\n" + boost::nowide::widen(error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user