-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow
Host
request header to override the http request host (#440)
* Add `allow_host_override` attribute that allows the `Host` request header to override the request host. * Remove duplicate host override * Add changelog entry * Update provider documentation * Remove feature flag for host overrides * Update documentation * Apply suggestions from code review Co-authored-by: Austin Valle <austinvalle@gmail.com> * Set `request.Host` in the same loop setting the request headers. * Add note changelog describing functionality change. --------- Co-authored-by: Austin Valle <austinvalle@gmail.com>
- Loading branch information
1 parent
ec7c3b8
commit fb5fd5a
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
kind: BUG FIXES | ||
body: 'data-source/http: Allow `Host` header in `request_headers` to be set on HTTP request' | ||
time: 2024-07-19T14:36:06.795798-04:00 | ||
custom: | ||
Issue: "440" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
kind: NOTES | ||
body: |+ | ||
data-source/http: Previous versions of this provider ignored any `Host` headers specified in the `request_headers` attribute when setting the HTTP request. Any specified `Host` request headers will now override the `url` attribute host. | ||
For example, in the following configuration: | ||
```hcl | ||
data "http" "example" { | ||
url = "https://www.example.com" | ||
request_headers = { | ||
Host = "www.differentexample.com" | ||
} | ||
} | ||
``` | ||
The HTTP request host will now be `www.differentexample.com` instead of `www.example.com`. | ||
time: 2024-07-23T16:25:43.160519-04:00 | ||
custom: | ||
Issue: "440" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters