Remove Port from registry
This commit is contained in:
@@ -73,7 +73,7 @@ func (h *httpHandler) getService(r *http.Request) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
return fmt.Sprintf("http://%s:%d", s.Address, s.Port), nil
|
||||
return fmt.Sprintf("http://%s", s.Address), nil
|
||||
}
|
||||
|
||||
func (h *httpHandler) String() string {
|
||||
|
@@ -4,8 +4,6 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/micro/go-micro/api/handler"
|
||||
@@ -26,21 +24,12 @@ func testHttp(t *testing.T, path, service, ns string) {
|
||||
}
|
||||
defer l.Close()
|
||||
|
||||
parts := strings.Split(l.Addr().String(), ":")
|
||||
|
||||
var host string
|
||||
var port int
|
||||
|
||||
host = parts[0]
|
||||
port, _ = strconv.Atoi(parts[1])
|
||||
|
||||
s := ®istry.Service{
|
||||
Name: service,
|
||||
Nodes: []*registry.Node{
|
||||
®istry.Node{
|
||||
Id: service + "-1",
|
||||
Address: host,
|
||||
Port: port,
|
||||
Address: l.Addr().String(),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ func (wh *webHandler) getService(r *http.Request) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
return fmt.Sprintf("http://%s:%d", s.Address, s.Port), nil
|
||||
return fmt.Sprintf("http://%s", s.Address), nil
|
||||
}
|
||||
|
||||
// serveWebSocket used to serve a web socket proxied connection
|
||||
|
Reference in New Issue
Block a user