accept and store plain posts containing text/json better

This commit is contained in:
Me No Dev 2016-01-21 19:28:29 +02:00
parent ebdfec9832
commit 01c3b6644d
1 changed files with 4 additions and 4 deletions

View File

@ -274,12 +274,12 @@ bool AsyncWebServerRequest::_parseReqHeader(){
}
void AsyncWebServerRequest::_parsePlainPostChar(uint8_t data){
if(data && (char)data != '\r' && (char)data != '\n' && (char)data != '&')
if(data && (char)data != '&')
_temp += (char)data;
if(!data || (char)data == '\n' || (char)data == '&' || _parsedLength == _contentLength){
if(!data || (char)data == '&' || _parsedLength == _contentLength){
_temp = _urlDecode(_temp);
String name = _temp;
String value = "";
String name = "body";
String value = _temp;
if(_temp.indexOf('=') > 0){
name = _temp.substring(0, _temp.indexOf('='));
value = _temp.substring(_temp.indexOf('=') + 1);