mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Reduce indentation of HTTPFetchOngoing
Also clean up some related things.
This commit is contained in:
parent
18bfa1c785
commit
86a3c8ce56
8 changed files with 318 additions and 321 deletions
11
src/mods.cpp
11
src/mods.cpp
|
@ -339,19 +339,14 @@ Json::Value getModstoreUrl(std::string url)
|
|||
|
||||
bool special_http_header = true;
|
||||
|
||||
try{
|
||||
try {
|
||||
special_http_header = g_settings->getBool("modstore_disable_special_http_header");
|
||||
}
|
||||
catch(SettingNotFoundException &e) {
|
||||
}
|
||||
} catch (SettingNotFoundException) {}
|
||||
|
||||
if (special_http_header) {
|
||||
extra_headers.push_back("Accept: application/vnd.minetest.mmdb-v1+json");
|
||||
return fetchJsonValue(url, &extra_headers);
|
||||
}
|
||||
else {
|
||||
return fetchJsonValue(url, NULL);
|
||||
}
|
||||
return fetchJsonValue(url, special_http_header ? &extra_headers : NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue