- if (special_http_header)
- chunk = curl_slist_append(chunk, "Accept: application/vnd.minetest.mmdb-v1+json");
-
- Json::Value retval = fetchJsonValue(url,chunk);
-
- if (chunk != NULL)
- curl_slist_free_all(chunk);
-
- return retval;
+ 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);
+ }