1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Fixed: urlDecode done before parsing args (#2956)

This commit is contained in:
Stephan Schreiber 2017-08-01 11:54:31 +02:00 committed by Ivan Grokhotkov
parent f05ed6e27d
commit f5b6e16474

View File

@ -91,7 +91,7 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
String searchStr = ""; String searchStr = "";
int hasSearch = url.indexOf('?'); int hasSearch = url.indexOf('?');
if (hasSearch != -1){ if (hasSearch != -1){
searchStr = urlDecode(url.substring(hasSearch + 1)); searchStr = url.substring(hasSearch + 1);
url = url.substring(0, hasSearch); url = url.substring(0, hasSearch);
} }
_currentUri = url; _currentUri = url;
@ -318,7 +318,7 @@ void ESP8266WebServer::_parseArguments(String data) {
} }
RequestArgument& arg = _currentArgs[iarg]; RequestArgument& arg = _currentArgs[iarg];
arg.key = data.substring(pos, equal_sign_index); arg.key = data.substring(pos, equal_sign_index);
arg.value = data.substring(equal_sign_index + 1, next_arg_index); arg.value = urlDecode(data.substring(equal_sign_index + 1, next_arg_index));
#ifdef DEBUG_ESP_HTTP_SERVER #ifdef DEBUG_ESP_HTTP_SERVER
DEBUG_OUTPUT.print("arg "); DEBUG_OUTPUT.print("arg ");
DEBUG_OUTPUT.print(iarg); DEBUG_OUTPUT.print(iarg);