diff --git a/cmd/zrok/endpoint_ui/index.gohtml b/cmd/zrok/endpoint_ui/index.gohtml index 9e103aa6..e4830560 100644 --- a/cmd/zrok/endpoint_ui/index.gohtml +++ b/cmd/zrok/endpoint_ui/index.gohtml @@ -12,6 +12,7 @@ - -
- - + diff --git a/cmd/zrok/test.go b/cmd/zrok/test.go index 17b7fafc..4e9b148a 100644 --- a/cmd/zrok/test.go +++ b/cmd/zrok/test.go @@ -61,24 +61,36 @@ func (cmd *testEndpointCommand) serveIndex(w http.ResponseWriter, r *http.Reques } type endpointData struct { - Now time.Time - Host string - Headers map[string][]string - Remote string - Ips string + Now time.Time + RemoteAddr string + Host string + HostDetail string + Ips string + HostHeader string + Headers map[string][]string } func newEndpointData(r *http.Request) *endpointData { ed := &endpointData{ - Now: time.Now(), - Host: r.Host, - Headers: r.Header, - Remote: r.RemoteAddr, + Now: time.Now(), + HostHeader: r.Host, + Headers: r.Header, + RemoteAddr: r.RemoteAddr, } + ed.getHostInfo() ed.getIps() return ed } +func (ed *endpointData) getHostInfo() { + host, hostDetail, err := getHost() + if err != nil { + logrus.Errorf("error getting host detail: %v", err) + } + ed.Host = host + ed.HostDetail = hostDetail +} + func (ed *endpointData) getIps() { addrs, err := net.InterfaceAddrs() if err == nil { diff --git a/rest_client_zrok/zrok_client.go b/rest_client_zrok/zrok_client.go index 8e2109ff..4a02b257 100644 --- a/rest_client_zrok/zrok_client.go +++ b/rest_client_zrok/zrok_client.go @@ -19,7 +19,7 @@ import ( var Default = NewHTTPClient(nil) const ( - // DefaultHost is the default Host + // DefaultHost is the default HostHeader // found in Meta (info) section of spec file DefaultHost string = "localhost" // DefaultBasePath is the default BasePath diff --git a/rest_server_zrok/doc.go b/rest_server_zrok/doc.go index bdbf2509..bf1d2dca 100644 --- a/rest_server_zrok/doc.go +++ b/rest_server_zrok/doc.go @@ -5,7 +5,7 @@ // zrok client access // Schemes: // http -// Host: localhost +// HostHeader: localhost // BasePath: /api/v1 // Version: 1.0.0 //