1111#include < SettingsSerializer.h>
1212#include < SettingsDeserializer.h>
1313
14- #define MAX_SETTINGS_SIZE 1024
14+ #define MAX_CONTENT_LENGTH 1024
1515#define SETTINGS_ENDPOINT_ORIGIN_ID " endpoint"
1616
1717template <class T >
@@ -37,7 +37,7 @@ class SettingsEndpoint {
3737 securityManager->wrapRequest (std::bind (&SettingsEndpoint::fetchSettings, this , std::placeholders::_1),
3838 authenticationPredicate));
3939 _updateHandler.setMethod (HTTP_POST);
40- _updateHandler.setMaxContentLength (MAX_SETTINGS_SIZE );
40+ _updateHandler.setMaxContentLength (MAX_CONTENT_LENGTH );
4141 server->addHandler (&_updateHandler);
4242 }
4343
@@ -53,7 +53,7 @@ class SettingsEndpoint {
5353 std::bind (&SettingsEndpoint::updateSettings, this , std::placeholders::_1, std::placeholders::_2)) {
5454 server->on (servicePath.c_str (), HTTP_GET, std::bind (&SettingsEndpoint::fetchSettings, this , std::placeholders::_1));
5555 _updateHandler.setMethod (HTTP_POST);
56- _updateHandler.setMaxContentLength (MAX_SETTINGS_SIZE );
56+ _updateHandler.setMaxContentLength (MAX_CONTENT_LENGTH );
5757 server->addHandler (&_updateHandler);
5858 }
5959
@@ -64,7 +64,7 @@ class SettingsEndpoint {
6464 AsyncCallbackJsonWebHandler _updateHandler;
6565
6666 void fetchSettings (AsyncWebServerRequest* request) {
67- AsyncJsonResponse* response = new AsyncJsonResponse (false , MAX_SETTINGS_SIZE );
67+ AsyncJsonResponse* response = new AsyncJsonResponse (false , MAX_CONTENT_LENGTH );
6868 _settingsService->read (
6969 [&](T& settings) { _settingsSerializer->serialize (settings, response->getRoot ().to <JsonObject>()); });
7070 response->setLength ();
@@ -73,7 +73,7 @@ class SettingsEndpoint {
7373
7474 void updateSettings (AsyncWebServerRequest* request, JsonVariant& json) {
7575 if (json.is <JsonObject>()) {
76- AsyncJsonResponse* response = new AsyncJsonResponse (false , MAX_SETTINGS_SIZE );
76+ AsyncJsonResponse* response = new AsyncJsonResponse (false , MAX_CONTENT_LENGTH );
7777
7878 // use callback to update the settings once the response is complete
7979 request->onDisconnect ([this ]() { _settingsService->callUpdateHandlers (SETTINGS_ENDPOINT_ORIGIN_ID); });
0 commit comments