mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
Avoid blank page (NULL) as response
This commit is contained in:
@@ -101,8 +101,15 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject & input) {
|
||||
}
|
||||
|
||||
// output json buffer
|
||||
auto * response = new PrettyAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXLARGE_DYN);
|
||||
JsonObject output = response->getRoot();
|
||||
auto * response = new PrettyAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXLARGE_DYN);
|
||||
if (!response->getSize()) {
|
||||
response = new PrettyAsyncJsonResponse(false, 256);
|
||||
response->setCode(507);
|
||||
response->setLength();
|
||||
request->send(response); // Insufficient Storage
|
||||
return;
|
||||
}
|
||||
JsonObject output = response->getRoot();
|
||||
|
||||
// call command
|
||||
uint8_t return_code = Command::process(request->url().c_str(), is_admin, input, output);
|
||||
|
||||
Reference in New Issue
Block a user