delete empty response

This commit is contained in:
MichaelDvP
2022-12-11 11:13:56 +01:00
parent 7e888f6408
commit 11fd833cdb
3 changed files with 9 additions and 7 deletions

View File

@@ -167,11 +167,11 @@ void WebDataService::device_data(AsyncWebServerRequest * request, JsonVariant &
if (json.is<JsonObject>()) {
auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXXLARGE_DYN);
if (!response->getSize()) {
// EMSESP::logger().err("Insufficient storage");
delete response;
response = new MsgpackAsyncJsonResponse(false, 256);
response->setCode(507);
response->setCode(507); // Insufficient Storage
response->setLength();
request->send(response); // Insufficient Storage (507)
request->send(response);
return;
}
for (const auto & emsdevice : EMSESP::emsdevices) {