mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-01 04:50:58 +02:00
Add MD5 computation to Esp and add request header with MD5 hash of the running sketch to HTTPUpdate (#2176)
This commit is contained in:
@ -181,8 +181,11 @@ HTTPUpdateResult HTTPUpdate::handleUpdate(HTTPClient& http, const String& curren
|
||||
http.addHeader("x-ESP32-AP-MAC", WiFi.softAPmacAddress());
|
||||
http.addHeader("x-ESP32-free-space", String(ESP.getFreeSketchSpace()));
|
||||
http.addHeader("x-ESP32-sketch-size", String(ESP.getSketchSize()));
|
||||
// To do http.addHeader("x-ESP32-sketch-md5", String(ESP.getSketchMD5()));
|
||||
// Sketch MD5 is not supported by the core, but SHA256 is, so add a SHA256 instead
|
||||
String sketchMD5 = ESP.getSketchMD5();
|
||||
if(sketchMD5.length() != 0) {
|
||||
http.addHeader("x-ESP32-sketch-md5", sketchMD5);
|
||||
}
|
||||
// Add also a SHA256
|
||||
String sketchSHA256 = getSketchSHA256();
|
||||
if(sketchSHA256.length() != 0) {
|
||||
http.addHeader("x-ESP32-sketch-sha256", sketchSHA256);
|
||||
|
Reference in New Issue
Block a user