From 3ed31e60e077dd9883aff520c3364bc627f5f8e4 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Wed, 14 Dec 2022 12:32:50 -0500 Subject: [PATCH] display the requested path in the test endpoint ui --- cmd/zrok/endpoint_ui/index.gohtml | 2 ++ cmd/zrok/test_endpoint.go | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/cmd/zrok/endpoint_ui/index.gohtml b/cmd/zrok/endpoint_ui/index.gohtml index e4830560..7353cf61 100644 --- a/cmd/zrok/endpoint_ui/index.gohtml +++ b/cmd/zrok/endpoint_ui/index.gohtml @@ -388,6 +388,8 @@
+

{{ .RequestedPath }}

+

{{ .Now }}

At This Endpoint:

diff --git a/cmd/zrok/test_endpoint.go b/cmd/zrok/test_endpoint.go index 0dfca0c2..5c066317 100644 --- a/cmd/zrok/test_endpoint.go +++ b/cmd/zrok/test_endpoint.go @@ -61,21 +61,23 @@ func (cmd *testEndpointCommand) serveIndex(w http.ResponseWriter, r *http.Reques } type endpointData struct { - Now time.Time - RemoteAddr string - Host string - HostDetail string - Ips string - HostHeader string - Headers map[string][]string + RequestedPath 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(), - HostHeader: r.Host, - Headers: r.Header, - RemoteAddr: r.RemoteAddr, + RequestedPath: r.RequestURI, + Now: time.Now(), + HostHeader: r.Host, + Headers: r.Header, + RemoteAddr: r.RemoteAddr, } ed.getHostInfo() ed.getIps()