You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
╷
│ Warning: Content-Type is not recognized as a text type, got "application/x-pem-file"
│
│ with data.http.mozilla_ca_certificates,
│ on .../ca_certificates.tf line 2, in data "http" "mozilla_ca_certificates":
│ 2: data "http" "mozilla_ca_certificates" {
│
│ If the content is binary data, Terraform may not properly handle the contents of the response.
╵
Proposal
application/x-pem-file is a text type, but the http provider does not recognise it as such and prints a warning. We track warnings emitted by Terraform when it runs under our CI/CD, and would like to eliminate this nuisance warning.
It's not realistic to expect the http provider to know whether any arbitrary MIME type is safe to round-trip through UTF-8, nor is that even generally possible given that there are vendor-defined MIME types.
A more robust solution (rather than just adding application/x-pem-file to the recognised text types) could be to add an attribute such as expected_content_type where the user of the provider can specify what content type they expect to receive. If the content type matches, no warning is emitted. This protects against the server later starting to return another (possibly non-text) content type. The documentation for this attribute could describe the caveat that the response must be text.
How much impact is this issue causing?
Low
Additional Information
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
I have even a bit worse problem: the server (and it's github serving releases) does not bother detecting or remembering the content type and simply says application/octet-stream even though the actual content is a valid utf-8-encoded yaml.
Terraform CLI and Provider Versions
Terraform v1.4.6
on darwin_arm64
Use Cases or Problem Statement
Proposal
application/x-pem-file
is a text type, but thehttp
provider does not recognise it as such and prints a warning. We track warnings emitted by Terraform when it runs under our CI/CD, and would like to eliminate this nuisance warning.It's not realistic to expect the
http
provider to know whether any arbitrary MIME type is safe to round-trip through UTF-8, nor is that even generally possible given that there are vendor-defined MIME types.A more robust solution (rather than just adding
application/x-pem-file
to the recognised text types) could be to add an attribute such asexpected_content_type
where the user of the provider can specify what content type they expect to receive. If the content type matches, no warning is emitted. This protects against the server later starting to return another (possibly non-text) content type. The documentation for this attribute could describe the caveat that the response must be text.How much impact is this issue causing?
Low
Additional Information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: