diff --git a/cmd/zrok/endpoint_ui/index.html b/cmd/zrok/endpoint_ui/index.html index 11fb38fa..a47ccb27 100644 --- a/cmd/zrok/endpoint_ui/index.html +++ b/cmd/zrok/endpoint_ui/index.html @@ -377,10 +377,28 @@
-

The Current Now is {{ .Now }}

-

The current 'HOST' header: {{ .Host }}

-

The remote host making the request: {{ .Remote }}

-

This host has these IP addresses: {{ .Ips }}

+

{{ .Now }}

+ +

Local:

+ + + + +
Host Header{{ .Host }}
Remote Address{{ .Remote }}
Local IP Addresses{{ .Ips }}
+ +

Headers:

+ + {{ range $header, $value := .Headers }} + + + + + {{ end }} +
{{ $header }} + {{ range $v := $value }} + {{ $v }} + {{ end }} +
diff --git a/cmd/zrok/test.go b/cmd/zrok/test.go index e99da69a..a0aa893f 100644 --- a/cmd/zrok/test.go +++ b/cmd/zrok/test.go @@ -56,22 +56,28 @@ func (cmd *testEndpointCommand) run(_ *cobra.Command, _ []string) { func (cmd *testEndpointCommand) serveIndex(w http.ResponseWriter, r *http.Request) { logrus.Infof("%v {%v} -> /index.html", r.RemoteAddr, r.Host) - ed := &endpointData{ - Now: time.Now(), - Host: r.Host, - Remote: r.RemoteAddr, - } - ed.getIps() - if err := cmd.t.Execute(w, ed); err != nil { + if err := cmd.t.Execute(w, newEndpointData(r)); err != nil { log.Error(err) } } type endpointData struct { - Now time.Time - Host string - Remote string - Ips string + Now time.Time + Host string + Headers map[string][]string + Remote string + Ips string +} + +func newEndpointData(r *http.Request) *endpointData { + ed := &endpointData{ + Now: time.Now(), + Host: r.Host, + Headers: r.Header, + Remote: r.RemoteAddr, + } + ed.getIps() + return ed } func (ed *endpointData) getIps() {