mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-05 07:07:38 +03:00
Use a JSON filter to avoid crashes when checking for updates
The source data can be quite large if the release description is large Fixes https://github.com/daveallie/crosspoint-reader/issues/124
This commit is contained in:
parent
f8c0b1acea
commit
fb0b82c4d9
@ -27,7 +27,12 @@ OtaUpdater::OtaUpdaterError OtaUpdater::checkForUpdate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
JsonDocument doc;
|
JsonDocument doc;
|
||||||
const DeserializationError error = deserializeJson(doc, *client);
|
JsonDocument filter;
|
||||||
|
filter["tag_name"] = true;
|
||||||
|
filter["assets"][0]["name"] = true;
|
||||||
|
filter["assets"][0]["browser_download_url"] = true;
|
||||||
|
filter["assets"][0]["size"] = true;
|
||||||
|
const DeserializationError error = deserializeJson(doc, *client, DeserializationOption::Filter(filter));
|
||||||
http.end();
|
http.end();
|
||||||
if (error) {
|
if (error) {
|
||||||
Serial.printf("[%lu] [OTA] JSON parse failed: %s\n", millis(), error.c_str());
|
Serial.printf("[%lu] [OTA] JSON parse failed: %s\n", millis(), error.c_str());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user