Added a User-Agent header for remote-state http backend client

Added a User-Agent header for the http client to determine which client call to the backend.
This commit is contained in:
NetMoose 2024-02-13 09:14:03 +05:00 committed by GitHub
parent e6665c4f43
commit b2154fb455
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,6 +60,7 @@ func (c *httpClient) httpRequest(method string, url *url.URL, data *[]byte, what
// Work with data/body
if data != nil {
req.Header.Set("Content-Type", "application/json")
req.Header.Set("User-Agent", "Terraform-http-client/1.1")
req.ContentLength = int64(len(*data))
// Generate the MD5