-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adding possibility to manually set MD5 checksum and authorization for HTTP update #7629
Conversation
@@ -121,6 +126,7 @@ class HTTPUpdate | |||
private: | |||
int _httpClientTimeout; | |||
followRedirects_t _followRedirects; | |||
String _md5Sum; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_md5Sum = String();
should be added in the class constructor after _followRedirects
is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But String _md5Sum;
means it is automatically initialized empty String instance, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the compiler will complain. The String is not necessarily initialized. You can initialize it in two general ways:
HTTPUpdate::HTTPUpdate(int httpClientTimeout): _httpClientTimeout(httpClientTimeout), _ledPin(-1), _md5Sum(){
_followRedirects = HTTPC_DISABLE_FOLLOW_REDIRECTS;
}
Or
HTTPUpdate::HTTPUpdate(int httpClientTimeout): _httpClientTimeout(httpClientTimeout), _ledPin(-1){
_followRedirects = HTTPC_DISABLE_FOLLOW_REDIRECTS;
_md5Sum = String();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, understood. Thanks for the correction 👍. Fixed.
ddddd9b
to
62ca5dd
Compare
I added also authorization. This will finally make this on par with ESP8266 HTTPUpdate. |
62ca5dd
to
d2fd7ad
Compare
@me-no-dev, what with this PR? |
Hi @vlastahajek ! We will have this merged for v3.0.0 |
I've written a library that allows updating from Github releases.
To verify firmware integrity HTTPUpdater already supports MD5 checksum but it is only read from the server response header. This is not possible if there is no control of the server.
If the checksum is known from another source, it is not possible to set it currently.
This PR allows this.
The same addition was already done for ESP8266.
Update 23.2.2023:
Adding also setting of authorization to allow connecting to a private server.
This is already part of ESP8266 HTTPUpdate.