These are chat archives for esp8266/Arduino

31st
Jan 2018
Russ Mathis
@RussMathis
Jan 31 2018 18:31
Help! using 2.4.0-rc2, and ESP8266WebServer.h, when getting a AJAX response containing a JSON.stringify, I have possible passwords containing the & character. However, on the ESP8266 server.arg("data"), only results in the sent string upto where the character & should be found. Is there a fix for this?
Russ Mathis
@RussMathis
Jan 31 2018 18:37

Web page significant part
self.saveData = function (cmd, target) {
.ajax(cmd, {
async: false,
timeout: 0,
data: jQuery.param({ d: JSON.stringify(target()) }),
type: "post",
contentType: "application/x-www-form-urlencoded",
success: function (result) { alert("Updated"); },
failure: function (result) { alert("Failed"); }
});
}

ESP significant part
String result = server.arg("d"));

Myles Eftos
@madpilot
Jan 31 2018 20:07
Are you encoding the & to %26 ?
Russ Mathis
@RussMathis
Jan 31 2018 21:15
Since the AJAX command has it contentType set to urlencoded, I assume so?
When trying to use server.arg() only the part of the string before the & is available. It basically lost 75% of the text--or anything after the & character?