Skip to content

Commit

Permalink
Revert "fix: keepAlive might cause nip pointer dereference panic (arg…
Browse files Browse the repository at this point in the history
…oproj#43)"

This reverts commit bd38cdd.
  • Loading branch information
gtrafimenkov committed Apr 15, 2022
1 parent 7b04c2f commit 68adb74
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions grpc/http/forwarders.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,11 @@ func NewStreamForwarder(messageKey func(proto.Message) (string, error)) StreamFo
opts ...func(context.Context, http.ResponseWriter, proto.Message) error,
) {
isSSE := req.Header.Get("Accept") == "text/event-stream"
processCtx, cancel := context.WithCancel(ctx)
defer cancel()
if isSSE {
w.Header().Set("Content-Type", "text/event-stream")
w.Header().Set("Transfer-Encoding", "chunked")
w.Header().Set("X-Content-Type-Options", "nosniff")
w = withKeepalive(processCtx, w)
w = withKeepalive(ctx, w)
}
dataByKey := make(map[string][]byte)
m := newMarshaler(req, isSSE)
Expand Down

0 comments on commit 68adb74

Please sign in to comment.