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

View File

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