carvel-dev / vendir

Easy way to vendor portions of git repos, github releases, helm charts, docker image contents, etc. declaratively
https://carvel.dev/vendir
Apache License 2.0
281 stars 50 forks source link

fix: avoid panic by checking response for nil #391

Closed Zebradil closed 2 months ago

Zebradil commented 2 months ago

Fixes #389.

This PR addresses two issues:

If the authorization header value contains a trailing newline, the http client returns error without a response struct (nil).

It is easy to miss a trailing newline when encoding a value into base64. To avoid inconvenience for users, let's trim it.