refactor: memory optimization for esp8266

This commit is contained in:
Yurii
2024-11-11 02:41:39 +03:00
parent 6a9bd9673a
commit fda18cdb13
17 changed files with 1044 additions and 788 deletions

View File

@@ -10,7 +10,8 @@ public:
free(this->buffer);
}
void send(int code, const char* contentType, const JsonVariantConst content, bool pretty = false) {
template <class T>
void send(int code, T contentType, const JsonVariantConst content, bool pretty = false) {
#ifdef ARDUINO_ARCH_ESP8266
if (!this->webServer->chunkedResponseModeStart(code, contentType)) {
this->webServer->send(505, F("text/html"), F("HTTP1.1 required"));