From 8c3d730b325be4dbbb713ae3c892d23ca3dc9c99 Mon Sep 17 00:00:00 2001 From: Ian Pun Date: Tue, 7 May 2024 10:08:01 -0700 Subject: [PATCH] fix issue with overriden default options --- gateway/grpc.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gateway/grpc.go b/gateway/grpc.go index 54ef3dec..451ad5f2 100644 --- a/gateway/grpc.go +++ b/gateway/grpc.go @@ -45,16 +45,18 @@ type GrpcGateway struct { // NewGrpcGateway returns a new gRPC gateway. func NewGrpcGateway(network config.Network, opts ...grpcAccess.ClientOption) (*GrpcGateway, error) { - opts = append( - opts, + options := append( + []grpcAccess.ClientOption{ grpcAccess.WithGRPCDialOptions( - grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxGRPCMessageSize), + grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxGRPCMessageSize)), ), - )) + }, + opts..., + ) gClient, err := grpcAccess.NewClient( network.Host, - opts..., + options..., ) if err != nil || gClient == nil {