1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-28 05:01:28 +03:00

fix parseArgument #2 (#5252)

* fix parseArgument

* remove recursion

* keep variable naming style consistent

* inviting Alexa

* fix alexa fix (well, trying...)

* fix pos substrings

key_end_pos--;
dont count down here, it will cut of every key by -1 ("save" will be "sav") (substring  (end = up to, but not including, so no need to -1)

Parsing cpp L329
arg.value = urlDecode(data.substring(equal_index + 1, next_index - 1));
=> -1 is too less for substring (substring  (end = up to, but not including, so no need to -1)

* alexa invite: add workaround for malformed x-www-form-urlencoded

* when !form, alway add content in key "plain"

* fix memleak

* parse arguments: use functors

* cleaning
This commit is contained in:
david gauchard
2018-10-17 04:18:45 +02:00
committed by Develo
parent d742df84e5
commit 64dd492eaa
2 changed files with 133 additions and 129 deletions

View File

@ -142,7 +142,8 @@ protected:
void _handleRequest();
void _finalizeResponse();
bool _parseRequest(WiFiClient& client);
void _parseArguments(String data);
void _parseArguments(const String& data);
int _parseArgumentsPrivate(const String& data, std::function<void(String&,String&,const String&,int,int,int,int)> handler);
static String _responseCodeToString(int code);
bool _parseForm(WiFiClient& client, String boundary, uint32_t len);
bool _parseFormUploadAborted();