terraform-provider-http
terraform-provider-http copied to clipboard
Support resending headers on redirects
Terraform CLI and Provider Versions
registry.terraform.io/hashicorp/http 3.4.2 Terraform: 1.3.4
Use Cases or Problem Statement
We have an API we read with the Terraform Data provider that will redirect the client to a different instance if the first instance is not authoritative for the requested data. The http provider appears to follow these redirects, but does not resend all the headers specified on the second request. (No logs of this, due to #395). Not sending the Authorization header is expected default behavior. However, there are cases where it is desirable. For example cURL contains the --location-trusted flag for this case. I would like to see a similar flag in this provider.
Proposal
Add a boolean location-trusted attribute to the provider. Default should be false, and the same behavior as we have today. When true the client resends all the headers specified in the original request on redirects.
How much impact is this issue causing?
Medium
Additional Information
https://curl.se/docs/manpage.html#--location-trusted
Code of Conduct
- [X] I agree to follow this project's Code of Conduct