arduino-libraries / Arduino_ESP32_OTA

Other
41 stars 16 forks source link

Follow Redirects & 400 Error #37

Open felixerdy opened 4 months ago

felixerdy commented 4 months ago

I'd like to use the library to download compiled .ota files from my latest GitHub release assets. In my example, I can access the latest .ota file using the following URL: https://github.com/sensebox/senseBox-bike-Arduino/releases/latest/download/senseBox-bike-atrai.ino.ota

This URL however redirects two times to the actual download link:

In my fork, I created a logic to follow redirects (https://github.com/arduino-libraries/Arduino_ESP32_OTA/compare/main...felixerdy:Arduino_ESP32_OTA:main) which itself works as intended. However, the https://objects.githubusercontent.com/... URL can't be consumed by the Library as it returns a 400 error. Using the same link in my browser however downloads the intended file.

Please note that I already added the needed certificates

Do you have an idea how to resolve the 400 error?

P.S.: I'd be happy to create a PR for the follow redirect code if you want me to