Skip to content

Commit

Permalink
Forwarder: Write event to request
Browse files Browse the repository at this point in the history
  • Loading branch information
creydr authored and knative-prow-robot committed Mar 18, 2024
1 parent cb942d1 commit 4c29c06
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/eventshub/forwarder/forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"time"

cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/cloudevents/sdk-go/v2/binding"
cloudeventsbindings "github.com/cloudevents/sdk-go/v2/binding"
"go.opencensus.io/trace"
"go.uber.org/zap"
Expand Down Expand Up @@ -171,6 +172,11 @@ func (o *Forwarder) ServeHTTP(writer http.ResponseWriter, request *http.Request)
}
req.URL = u

err = cehttp.WriteRequest(requestCtx, binding.ToMessage(event), req)
if err != nil {
logging.FromContext(o.ctx).Error("Cannot write the event to request: ", err)
}

eventString := "unknown"
if event != nil {
eventString = event.String()
Expand Down

0 comments on commit 4c29c06

Please sign in to comment.