flatcar / flatcar-build-scripts

A set of helper scripts for building Flatcar Linux. It includes scripts that should be independent of the existing `scripts` repository.
Apache License 2.0
2 stars 5 forks source link

resty: Add workaround for new curl versions #157

Closed pothos closed 6 months ago

pothos commented 6 months ago

As Mathieu found out, his new curl version won't process the empty string being passed to curl as argument, resulting from the no-body case for GET. The empty string was treated as additional URL which was skipped over in the past with a warning but now it's a hard error.

How to use

Testing done

With

touch /tmp/flatcar_production_update.gz
NOUPLOAD=1 ./upload_package /tmp https://staging.updateservice.flatcar-linux.net notused 9.9.9

I checked that the get_package_id shows the error for wrong curl arguments when switching the body_arg=() assignment to =(--unknown). It now also prints the curl errors when curl hits an HTTP error code which is the case for the final POST in the above test.

pothos commented 6 months ago

One can also do the test with NOUPLOAD=1 ./upload_package /tmp http://localhost:8000 notused 9.9.9 when running printf "HTTP/1.1 200 OK\r\n\r\n" |nc -l -p 8000; printf "HTTP/1.1 200 OK\r\n\r\n" | nc -l -p 8000 as server