1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

lets make it possible to parse multiline plain post

This commit is contained in:
John Doe 2015-07-05 21:43:52 +03:00 committed by Ivan Grokhotkov
parent f7212154a6
commit cca89efbd2

View File

@ -109,12 +109,19 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
if (!isForm){
if (searchStr != "") searchStr += '&';
String bodyLine = client.readStringUntil('\r');
#ifdef DEBUG
DEBUG_OUTPUT.print("Plain: ");
DEBUG_OUTPUT.println(bodyLine);
#endif
if(bodyLine.startsWith("{") || bodyLine.startsWith("[") || bodyLine.indexOf('=') == -1){
//plain post json or other data
searchStr += "plain=";
searchStr += bodyLine;
searchStr += client.readString();
} else {
searchStr += bodyLine;
client.readStringUntil('\n');
}
searchStr += bodyLine;
client.readStringUntil('\n');
}
_parseArguments(searchStr);
if (isForm){