Skip to content

Commit

Permalink
add ctx to request
Browse files Browse the repository at this point in the history
  • Loading branch information
m-yosefpor committed Dec 28, 2021
1 parent 9868299 commit 80dbfe0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*.dll
*.so
*.dylib
health_exporter

# Test binary, built with `go test -c`
*.test
Expand Down
2 changes: 1 addition & 1 deletion prober/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (h *HTTP) sendRequest(ctx context.Context) HTTPResult {
},
}

req, _ := http.NewRequest(http.MethodGet, h.URL, nil)
req, _ := http.NewRequestWithContext(ctx, http.MethodGet, h.URL, nil)
clientTraceCtx := httptrace.WithClientTrace(req.Context(), httpTrace)
req = req.WithContext(clientTraceCtx)
if h.Host != "" {
Expand Down

0 comments on commit 80dbfe0

Please sign in to comment.