Skip to content

Commit

Permalink
debug : print request metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
hxms committed Jan 11, 2024
1 parent 7e63833 commit 65c243c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions api/handler/rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ func (h *rpcHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
md[textproto.CanonicalMIMEHeaderKey(k)] = r.Header.Get(k)
}

fmt.Printf("md: %v\n", md)

// merge context with overwrite
cx = metadata.MergeContext(cx, md, true)

Expand Down
3 changes: 3 additions & 0 deletions client/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ func (g *grpcClient) call(ctx context.Context, node *registry.Node, req client.R
// fix : grpc error "stream terminated by RST_STREAM with error code: PROTOCOL_ERROR"
delete(header, "connection")

fmt.Printf("grpcClient.call: header: %v\n", header)
header = map[string]string{}

md := gmetadata.New(header)
ctx = gmetadata.NewOutgoingContext(ctx, md)

Expand Down

0 comments on commit 65c243c

Please sign in to comment.