hashicorp / go-getter

Package for downloading things from a string URL using a variety of protocols.
Mozilla Public License 2.0
1.62k stars 227 forks source link

"net/url" does not support parsing all supported protocols, such as gcs or s3 #476

Open bisharaah opened 4 months ago

bisharaah commented 4 months ago

Hello,

Noticed that in helper/url/url.go you are using "net/url" to parse, but as far as I know, it does not support parsing all supported protocols formats such as: gcs::https://www.googleapis.com/storage/v1/bucket1/foo.img The parsed url.URL output will have:

  1. Scheme as gcs
  2. Opaque as :https://www.googleapis.com/storage/v1/bucket1/foo.img
  3. everything else is either an empty string, false or nil

This is causing the client's GetChecksum call to fail because if the checksum is of a similar format, for example file:gcs::https://www.googleapis.com/storage/v1/bucket1/SHA256SUMS, it will pass the request Src to parse and pass the empty string as the checksummedPath to the checksumFromFile call which will cause it to not find any suitable checksum.

Please fix.

Thanks,