summaryrefslogtreecommitdiff
path: root/src/mods.cpp
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-09-14 20:46:45 -0400
committerShadowNinja <shadowninja@minetest.net>2014-09-18 21:54:22 -0400
commit86a3c8ce566f28112dc032aa48c40e12fde97be2 (patch)
tree26b688e66efb45803081537023461c57991ef049 /src/mods.cpp
parent18bfa1c785a123499ee12d0551a9447a4d32d93b (diff)
downloadminetest-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.cpp11
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