Remove excessive whitespaces and newlines in json (#1904)

* .

* .

* .

* .

* .

* remove newlines in json as it is not needed

* .

Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
CaCO3
2023-01-23 19:08:24 +01:00
committed by GitHub
parent 90d7c2e641
commit 5dc111e7a5
2 changed files with 40 additions and 44 deletions

View File

@@ -356,20 +356,18 @@ esp_err_t sysinfo_handler(httpd_req_t *req)
const char *hostname;
ESP_ERROR_CHECK(tcpip_adapter_get_hostname(TCPIP_ADAPTER_IF_STA, &hostname));
zw = "[\
{\
\"firmware\" : \"" + gitversion + "\",\
\"buildtime\" : \"" + buildtime + "\",\
\"gitbranch\" : \"" + gitbranch + "\",\
\"gittag\" : \"" + gittag + "\",\
\"gitrevision\" : \"" + gitrevision + "\",\
\"html\" : \"" + htmlversion + "\",\
\"cputemp\" : \"" + cputemp + "\",\
\"hostname\" : \"" + hostname + "\",\
\"IPv4\" : \"" + ip4addr_ntoa(&ip_info.ip) + "\",\
\"freeHeapMem\" : \"" + freeheapmem + "\"\
}\
]";
zw = string("[{") +
"\"firmware\": \"" + gitversion + "\"," +
"\"buildtime\": \"" + buildtime + "\"," +
"\"gitbranch\": \"" + gitbranch + "\"," +
"\"gittag\": \"" + gittag + "\"," +
"\"gitrevision\": \"" + gitrevision + "\"," +
"\"html\": \"" + htmlversion + "\"," +
"\"cputemp\": \"" + cputemp + "\"," +
"\"hostname\": \"" + hostname + "\"," +
"\"IPv4\": \"" + ip4addr_ntoa(&ip_info.ip) + "\"," +
"\"freeHeapMem\": \"" + freeheapmem + "\"" +
"}]";
resp_str = zw.c_str();