Skip to content

Commit cca89ef

Browse files
John Doeigrr
authored andcommitted
lets make it possible to parse multiline plain post
1 parent f721215 commit cca89ef

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

libraries/ESP8266WebServer/src/Parsing.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,19 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
109109
if (!isForm){
110110
if (searchStr != "") searchStr += '&';
111111
String bodyLine = client.readStringUntil('\r');
112+
#ifdef DEBUG
113+
DEBUG_OUTPUT.print("Plain: ");
114+
DEBUG_OUTPUT.println(bodyLine);
115+
#endif
112116
if(bodyLine.startsWith("{") || bodyLine.startsWith("[") || bodyLine.indexOf('=') == -1){
113117
//plain post json or other data
114118
searchStr += "plain=";
119+
searchStr += bodyLine;
120+
searchStr += client.readString();
121+
} else {
122+
searchStr += bodyLine;
123+
client.readStringUntil('\n');
115124
}
116-
searchStr += bodyLine;
117-
client.readStringUntil('\n');
118125
}
119126
_parseArguments(searchStr);
120127
if (isForm){

0 commit comments

Comments
 (0)