Skip to content

Commit

Permalink
http prober: Fix error checking (#723)
Browse files Browse the repository at this point in the history
Not sure if that can be triggered in real scenarios.

Signed-off-by: Julien Pivotto <[email protected]>
  • Loading branch information
roidelapluie authored Dec 14, 2020
1 parent 0737f28 commit 998037b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prober/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,12 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr
}

request, err := http.NewRequest(httpConfig.Method, targetURL.String(), body)
request.Host = origHost
request = request.WithContext(ctx)
if err != nil {
level.Error(logger).Log("msg", "Error creating request", "err", err)
return
}
request.Host = origHost
request = request.WithContext(ctx)

for key, value := range httpConfig.Headers {
if strings.Title(key) == "Host" {
Expand Down

0 comments on commit 998037b

Please sign in to comment.