Remove Port from registry
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/micro/go-micro/registry"
|
||||
@@ -30,16 +29,12 @@ func TestRoundTripper(t *testing.T) {
|
||||
|
||||
go http.Serve(l, nil)
|
||||
|
||||
host, p, _ := net.SplitHostPort(l.Addr().String())
|
||||
port, _ := strconv.Atoi(p)
|
||||
|
||||
m.Register(®istry.Service{
|
||||
Name: "example.com",
|
||||
Nodes: []*registry.Node{
|
||||
{
|
||||
Id: "1",
|
||||
Address: host,
|
||||
Port: port,
|
||||
Address: l.Addr().String(),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
@@ -2,7 +2,6 @@ package http
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/micro/go-micro/client/selector"
|
||||
@@ -28,7 +27,7 @@ func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
req.URL.Host = fmt.Sprintf("%s:%d", n.Address, n.Port)
|
||||
req.URL.Host = n.Address
|
||||
w, err := r.rt.RoundTrip(req)
|
||||
if err != nil {
|
||||
continue
|
||||
|
Reference in New Issue
Block a user