mirror of https://github.com/grpc/grpc-go.git
Remove port when assignning to CallHdr.Host
This commit is contained in:
parent
bdce4ae018
commit
dbe8c6ed11
7
call.go
7
call.go
|
@ -35,6 +35,7 @@ package grpc
|
|||
|
||||
import (
|
||||
"io"
|
||||
"net"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"golang.org/x/net/context"
|
||||
|
@ -114,8 +115,12 @@ func Invoke(ctx context.Context, method string, args, reply proto.Message, cc *C
|
|||
o.after(&c)
|
||||
}
|
||||
}()
|
||||
host, _, err := net.SplitHostPort(cc.target)
|
||||
if err != nil {
|
||||
return toRPCErr(err)
|
||||
}
|
||||
callHdr := &transport.CallHdr{
|
||||
Host: cc.target,
|
||||
Host: host,
|
||||
Method: method,
|
||||
}
|
||||
topts := &transport.Options{
|
||||
|
|
|
@ -36,6 +36,7 @@ package grpc
|
|||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"golang.org/x/net/context"
|
||||
|
@ -95,8 +96,12 @@ type ClientStream interface {
|
|||
// by generated code.
|
||||
func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) {
|
||||
// TODO(zhaoq): CallOption is omitted. Add support when it is needed.
|
||||
host, _, err := net.SplitHostPort(cc.target)
|
||||
if err != nil {
|
||||
return nil, toRPCErr(err)
|
||||
}
|
||||
callHdr := &transport.CallHdr{
|
||||
Host: cc.target,
|
||||
Host: host,
|
||||
Method: method,
|
||||
}
|
||||
t, _, err := cc.wait(ctx, 0)
|
||||
|
|
Loading…
Reference in New Issue