Skip to content

Commit c83788f

Browse files
committed
Fix panic on HTTP requests that fails reaching any provider
1 parent 02bcdff commit c83788f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/http.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,11 @@ func IncomingHttpHandler(ctx context.Context, endpoint *Endpoint, w http.Respons
156156
res, provider, err := ProxyHTTP(ctx, endpoint, req, timing)
157157

158158
if err != nil {
159+
if provider != nil {
159160
for _, req := range req.Requests {
160161
metrics.RecordFailedRequest(endpoint.Name, provider.Name, "http", req.Method)
161162
}
163+
}
162164

163165
if err == ErrNoProvidersAvailable {
164166
log.Error("no providers available")

0 commit comments

Comments
 (0)