cyberman54 / ESP32-Paxcounter

Wifi & BLE driven passenger flow metering with cheap ESP32 boards
https://cyberman54.github.io/ESP32-Paxcounter/
Other
1.69k stars 397 forks source link

treat http headers case insensitive in OTA #737

Closed FlorianLudwig closed 3 years ago

FlorianLudwig commented 3 years ago

HTTP Headers are case insensitive. But the OTA client expects them in a certain case. This patch makes the client treat http headers case insensitive.

This makes it easier to use a different server for storing update files.

cyberman54 commented 3 years ago

Thanks for the PR! While ota.cpp with Bintray worked surprisingly stable, the code now needs to be refactored as a whole, before Bintray is taken down, as announced for May 2021.

The original ESP32 ota sample code serves a possible template:

https://github.com/espressif/esp-idf/blob/6e77694/examples/system/ota/simple_ota_example/main/simple_ota_example.c

FlorianLudwig commented 3 years ago

My solution was to host the firmware files myself and have a bintray-compatible api for metadata so that the update code just needs to change the domain and certificates.

While implementing that I stumbled upon the issue that the update code used case-sensitive headers.

cyberman54 commented 3 years ago

Using this high level API could be an alternative approach: https://github.com/espressif/arduino-esp32/blob/master/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino