diff options
author | ShadowNinja <shadowninja@minetest.net> | 2014-09-14 20:46:45 -0400 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2014-09-18 21:54:22 -0400 |
commit | 86a3c8ce566f28112dc032aa48c40e12fde97be2 (patch) | |
tree | 26b688e66efb45803081537023461c57991ef049 /src/mods.cpp | |
parent | 18bfa1c785a123499ee12d0551a9447a4d32d93b (diff) | |
download | minetest-86a3c8ce566f28112dc032aa48c40e12fde97be2.tar.gz minetest-86a3c8ce566f28112dc032aa48c40e12fde97be2.tar.bz2 minetest-86a3c8ce566f28112dc032aa48c40e12fde97be2.zip |
Reduce indentation of HTTPFetchOngoing
Also clean up some related things.
Diffstat (limited to 'src/mods.cpp')
-rw-r--r-- | src/mods.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mods.cpp b/src/mods.cpp index b4e075b1e..7d6b4f5f7 100644 --- a/src/mods.cpp +++ b/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 |