diff --git a/src/WebRequest.cpp b/src/WebRequest.cpp index bbce5ca4c..207879bac 100644 --- a/src/WebRequest.cpp +++ b/src/WebRequest.cpp @@ -28,7 +28,14 @@ static const String SharedEmptyString = String(); -#define __is_param_char(c) ((c) && ((c) != '{') && ((c) != '[') && ((c) != '&') && ((c) != '=')) +bool is_param_char(char c) { + return + (c != 0) && + (c != '{') && + (c != '[') && + (c != '&') && + (c != '='); +} enum { PARSE_REQ_START, PARSE_REQ_HEADERS, PARSE_REQ_BODY, PARSE_REQ_END, PARSE_REQ_FAIL }; @@ -145,9 +152,9 @@ void AsyncWebServerRequest::_onData(void *buf, size_t len){ if(_parsedLength == 0){ if(_contentType.startsWith("application/x-www-form-urlencoded")){ _isPlainPost = true; - } else if(_contentType == "text/plain" && __is_param_char(((char*)buf)[0])){ + } else if(_contentType == "text/plain" && is_param_char(((char*)buf)[0])){ size_t i = 0; - while (i