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:
parent
f7212154a6
commit
cca89efbd2
@ -109,12 +109,19 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
|
|||||||
if (!isForm){
|
if (!isForm){
|
||||||
if (searchStr != "") searchStr += '&';
|
if (searchStr != "") searchStr += '&';
|
||||||
String bodyLine = client.readStringUntil('\r');
|
String bodyLine = client.readStringUntil('\r');
|
||||||
|
#ifdef DEBUG
|
||||||
|
DEBUG_OUTPUT.print("Plain: ");
|
||||||
|
DEBUG_OUTPUT.println(bodyLine);
|
||||||
|
#endif
|
||||||
if(bodyLine.startsWith("{") || bodyLine.startsWith("[") || bodyLine.indexOf('=') == -1){
|
if(bodyLine.startsWith("{") || bodyLine.startsWith("[") || bodyLine.indexOf('=') == -1){
|
||||||
//plain post json or other data
|
//plain post json or other data
|
||||||
searchStr += "plain=";
|
searchStr += "plain=";
|
||||||
|
searchStr += bodyLine;
|
||||||
|
searchStr += client.readString();
|
||||||
|
} else {
|
||||||
|
searchStr += bodyLine;
|
||||||
|
client.readStringUntil('\n');
|
||||||
}
|
}
|
||||||
searchStr += bodyLine;
|
|
||||||
client.readStringUntil('\n');
|
|
||||||
}
|
}
|
||||||
_parseArguments(searchStr);
|
_parseArguments(searchStr);
|
||||||
if (isForm){
|
if (isForm){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user