Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #29 from qistoph/checkhash
Browse files Browse the repository at this point in the history
Check hash of firmware
  • Loading branch information
ayushsharma82 authored Aug 14, 2020
2 parents ce8b5d4 + 9a3e293 commit d67ca29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/AsyncElegantOTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ class AsyncElegantOtaClass{
}

if (!index) {
if(request->hasParam("MD5", true)) {
return request->send(400, "text/plain", "MD5 parameter missing");
}

const String sentMd5 = request->getParam("MD5", true)->value();
if(!Update.setMD5(sentMd5.c_str())) {
return request->send(400, "text/plain", "MD5 parameter invalid");
}

#if defined(ESP8266)
int cmd = (filename == "filesystem") ? U_FS : U_FLASH;
Update.runAsync(true);
Expand Down
4 changes: 2 additions & 2 deletions src/elegantWebpage.h

Large diffs are not rendered by default.

0 comments on commit d67ca29

Please sign in to comment.