Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions transport/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ func NewUnaryHandler(e endpoint.Endpoint, dec decodeRequestFunc, enc encodeRespo

req, err := dec(c, l)
if err != nil {
return errorEncoder(c, err)
if !c.Response().Committed {
return errorEncoder(c, err)
}
l.Warn("response headers already written", "err", err)
}

resp, err := e(ctx, req)
if err != nil {
return errorEncoder(c, err)
if !c.Response().Committed {
return errorEncoder(c, err)
}
l.Warn("response headers already written", "err", err)
}

if err := enc(ctx, w, resp); err != nil {
Expand Down