fix JSON memory allocation for '/esp_status'

- removed predefined memory allocation for DynamicJsonDocument as the
size could vary depeneding on what options are enabled
This commit is contained in:
debsahu 2018-06-19 19:25:01 -04:00
parent 55e7ba80c2
commit 4994d59f9b

View file

@ -492,7 +492,7 @@ void setup() {
}, handleFileUpload);
//get heap status, analog input value and all GPIO statuses in one json call
server.on("/esp_status", HTTP_GET, []() {
DynamicJsonDocument jsonBuffer(JSON_OBJECT_SIZE(9));
DynamicJsonDocument jsonBuffer;
JsonObject& json = jsonBuffer.to<JsonObject>();
json["HOSTNAME"] = HOSTNAME;