The filename magic parameter sometimes isn't removed from the underlying request, which make some requests fail, e.g. when using signed URLs to GCS bucket.
Details
Based on the code, I believe all the "magic" parameters should be removed before making a request.
This is not the case in case of an URL to tar.gz directory, like this:
Description
The
filename
magic parameter sometimes isn't removed from the underlying request, which make some requests fail, e.g. when using signed URLs to GCS bucket.Details
Based on the code, I believe all the "magic" parameters should be removed before making a request. This is not the case in case of an URL to
tar.gz
directory, like this:and configuration:
I tracked the code execution, and it falls in the if which changes the mode:
https://github.com/hashicorp/go-getter/blob/a2ebce998f8d4105bd4b78d6c99a12803ad97a45/client.go#L217
Which is why the
filename
param is not removed, as the nextif
is skipped, which actually removes thefilename
param.https://github.com/hashicorp/go-getter/blob/a2ebce998f8d4105bd4b78d6c99a12803ad97a45/client.go#L230-L249
Fix incoming
I fixed it locally and will prepare a pull request soon. Hope you'll like it!