Fixed panic if malformed 3rd party url is specified by cmaglie · Pull Request #2817 · arduino/arduino-cli (original) (raw)

Please check if the PR fulfills these requirements

See how to contribute

What kind of change does this PR introduce?

Fix the panic reported in #2786

What is the current behavior?

The arduino-cli panics by reproducing the steps described in #2786

What is the new behavior?

$ arduino-cli update-index
Error initializing instance: Invalid additional URL: parse "foo=https://arduino.esp8266.com/stable/package_esp8266com_index.json": first path segment in URL cannot contain colon
Downloading index: package_index.tar.bz2 downloaded                                                                                                                           
Downloading index: foo=https://espressif.github.io/arduino-esp32/package_esp32_index.json Unable to parse URL: parse "foo=https://espressif.github.io/arduino-esp32/package_esp32_index.json": first path segment in URL cannot contain colon
Some indexes could not be updated.
$

Does this PR introduce a breaking change, and is titled accordingly?

Other information

Fix #2786