Skip to content

Allow charset=utf-8 in response Content-Type#5

Merged
apparentlymart merged 1 commit intohashicorp:masterfrom
mkjois:fix/allow-charset-utf-8
Sep 18, 2017
Merged

Allow charset=utf-8 in response Content-Type#5
apparentlymart merged 1 commit intohashicorp:masterfrom
mkjois:fix/allow-charset-utf-8

Conversation

@mkjois
Copy link
Copy Markdown

@mkjois mkjois commented Sep 18, 2017

Addresses #1 which clones hashicorp/terraform#15164. Uses mime for proper parsing.

Testing

2 new test cases which both working correctly after change:

  • allow response with Content-Type: text/plain; charset=utf-8
  • disallow response with Content-Type application/json; charset=utf-16

@apparentlymart
Copy link
Copy Markdown
Contributor

Thanks for working on this, @mkjois! This looks good to me.

@shan0809
Copy link
Copy Markdown

Hi i am trying to fetch data from external source using the http provider however it is failing with below err:

Error: Unsupported block type

on var.tf line 57, in data "http" "OMSAgent":
57: request_headers {

Blocks of type "request_headers" are not expected here. Did you mean to define
argument "request_headers"? If so, use the equals sign to assign it a value.

Releasing state lock. This may take a few moments...

Code :
data "http" "OMSAgent" {
url = "https://github.com/microsoft/OMS-Agent-for-Linux/blob/master/installer/scripts/onboard_agent.sh"
request_headers {
Accept = "text/plain"
}
}

@github-actions
Copy link
Copy Markdown

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants