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.
This commit is contained in:
sasodoma 2020-10-03 01:13:27 +02:00 committed by GitHub
parent ccab428e4d
commit 219ff3005b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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:

View File

@ -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) {