From 219ff3005b196ebc84c89eebef7794babcfa7a09 Mon Sep 17 00:00:00 2001 From: sasodoma Date: Sat, 3 Oct 2020 01:13:27 +0200 Subject: [PATCH] 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. --- libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino | 2 +- .../HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino b/libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino index f646be04..e98a5851 100644 --- a/libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino +++ b/libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino @@ -52,7 +52,7 @@ void loop() { t_httpUpdate_return ret = httpUpdate.update(client, "http://server/file.bin"); // Or: - //t_httpUpdate_return ret = httpUpdate.update(client, "server", 80, "file.bin"); + //t_httpUpdate_return ret = httpUpdate.update(client, "server", 80, "/file.bin"); switch (ret) { case HTTP_UPDATE_FAILED: diff --git a/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino b/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino index 5daa2a4f..1c85ace0 100644 --- a/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino +++ b/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino @@ -108,7 +108,7 @@ void loop() { t_httpUpdate_return ret = httpUpdate.update(client, "https://server/file.bin"); // Or: - //t_httpUpdate_return ret = httpUpdate.update(client, "server", 443, "file.bin"); + //t_httpUpdate_return ret = httpUpdate.update(client, "server", 443, "/file.bin"); switch (ret) {