Skip to content

Commit 219ff30

Browse files
authored
Add missing slashes in HTTPUpdate examples (#4238)
I spent quite a while today figuring out how to get an OTA update over HTTPS on a custom port working. A part of my problem was not putting a slash before the .bin filename, since it wasn't there in the example. This produced invalid HTTP requests. Adding the slash would make it clear that it needs to be there. Given that the URL in line 53 contains the same words "server" and "file.bin", one might assume that in line 55, the slash after the port number would get added automatically, however I have found out that without a slash you get an invalid request. Adding the slash removes any doubt.
1 parent ccab428 commit 219ff30

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void loop() {
5252

5353
t_httpUpdate_return ret = httpUpdate.update(client, "http://server/file.bin");
5454
// Or:
55-
//t_httpUpdate_return ret = httpUpdate.update(client, "server", 80, "file.bin");
55+
//t_httpUpdate_return ret = httpUpdate.update(client, "server", 80, "/file.bin");
5656

5757
switch (ret) {
5858
case HTTP_UPDATE_FAILED:

Diff for: libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void loop() {
108108

109109
t_httpUpdate_return ret = httpUpdate.update(client, "https://server/file.bin");
110110
// Or:
111-
//t_httpUpdate_return ret = httpUpdate.update(client, "server", 443, "file.bin");
111+
//t_httpUpdate_return ret = httpUpdate.update(client, "server", 443, "/file.bin");
112112

113113

114114
switch (ret) {

0 commit comments

Comments
 (0)