Skip to content

Commit

Permalink
change to use req.GetHTTPHeaders
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac committed Oct 18, 2024
1 parent ba6a68b commit f004999
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/plugin/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ func (d *Datasource) query(ctx context.Context, req *backend.QueryDataRequest, q
return nil, err
}

for key, value := range req.Headers {
request.Header.Set(key, value)
for key, value := range req.GetHTTPHeaders() {
request.Header[key] = value
}
resp, err := d.httpClient.Do(request)
if err != nil {
Expand Down Expand Up @@ -219,8 +219,8 @@ func (d *Datasource) CheckHealth(ctx context.Context, req *backend.CheckHealthRe
return nil, err
}

for key, value := range req.Headers {
request.Header.Set(key, value)
for key, value := range req.GetHTTPHeaders() {
request.Header[key] = value
}
resp, err := d.httpClient.Do(request)
if err != nil {
Expand Down

0 comments on commit f004999

Please sign in to comment.