Skip to content

Commit

Permalink
Move error checking further up (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensf authored and bwplotka committed Oct 17, 2018
1 parent d5b35f6 commit 0f1106e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion proxy/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ func (s *handler) handler(srv interface{}, serverStream grpc.ServerStream) error
}
// We require that the director's returned context inherits from the serverStream.Context().
outgoingCtx, backendConn, err := s.director(serverStream.Context(), fullMethodName)
clientCtx, clientCancel := context.WithCancel(outgoingCtx)
if err != nil {
return err
}

clientCtx, clientCancel := context.WithCancel(outgoingCtx)
// TODO(mwitkow): Add a `forwarded` header to metadata, https://en.wikipedia.org/wiki/X-Forwarded-For.
clientStream, err := grpc.NewClientStream(clientCtx, clientStreamDescForProxying, backendConn, fullMethodName)
if err != nil {
Expand Down

0 comments on commit 0f1106e

Please sign in to comment.