Skip to content

Commit

Permalink
fix: no more panic in the execute request method (#7947)
Browse files Browse the repository at this point in the history
Signed-off-by: Calum Murray <cmurray@redhat.com>
  • Loading branch information
Cali0707 committed May 29, 2024
1 parent abdbf14 commit 746dc52
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/kncloudevents/event_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,18 @@ func (d *Dispatcher) send(ctx context.Context, message binding.Message, destinat
}

func (d *Dispatcher) executeRequest(ctx context.Context, target duckv1.Addressable, message cloudevents.Message, additionalHeaders http.Header, retryConfig *RetryConfig, oidcServiceAccount *types.NamespacedName, transformers ...binding.Transformer) (context.Context, cloudevents.Message, *DispatchInfo, error) {
var scheme string
if target.URL != nil {
scheme = target.URL.Scheme
} else {
// assume that the scheme is http by default
scheme = "http"
}
dispatchInfo := DispatchInfo{
Duration: NoDuration,
ResponseCode: NoResponse,
ResponseHeader: make(http.Header),
Scheme: target.URL.Scheme,
Scheme: scheme,
}

ctx, span := trace.StartSpan(ctx, "knative.dev", trace.WithSpanKind(trace.SpanKindClient))
Expand Down

0 comments on commit 746dc52

Please sign in to comment.