diff --git a/libraries/ESP8266WebServer/src/Parsing-impl.h b/libraries/ESP8266WebServer/src/Parsing-impl.h index 8f85b7ad50..1a6a54f164 100644 --- a/libraries/ESP8266WebServer/src/Parsing-impl.h +++ b/libraries/ESP8266WebServer/src/Parsing-impl.h @@ -520,7 +520,7 @@ String ESP8266WebServerTemplate::urlDecode(const String& text) char temp[] = "0x00"; unsigned int len = text.length(); unsigned int i = 0; - decoded.reserve(len); + decoded.reserve(len - (std::count(text.begin(), text.end(), '%') * 2 )); while (i < len) { char decodedChar;