From 4240b337d50a09dd7e7b432253cfb27570d08caf Mon Sep 17 00:00:00 2001 From: Emil Muratov Date: Tue, 2 Jul 2024 14:18:51 +0900 Subject: [PATCH] replace String::clear() with copy contructor for PRI --- src/WebRequest.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/WebRequest.cpp b/src/WebRequest.cpp index 28ba483..181f177 100644 --- a/src/WebRequest.cpp +++ b/src/WebRequest.cpp @@ -321,7 +321,12 @@ bool AsyncWebServerRequest::_parseReqHeader() { } _headers.emplace_back(name, value); } +#ifndef TARGET_RP2040 _temp.clear(); +#else + // Ancient PRI core does not have String::clear() method 8-() + _temp = String(); +#endif return true; } @@ -336,7 +341,13 @@ void AsyncWebServerRequest::_parsePlainPostChar(uint8_t data) { value = _temp.substring(_temp.indexOf('=') + 1); } _params.emplace_back(urlDecode(name), urlDecode(value), true); - _temp = String(); + +#ifndef TARGET_RP2040 + _temp.clear(); +#else + // Ancient PRI core does not have String::clear() method 8-() + _temp = String(); +#endif } }