display the requested path in the test endpoint ui

This commit is contained in:
Michael Quigley 2022-12-14 12:32:50 -05:00
parent 0b9d61b961
commit 3ed31e60e0
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 15 additions and 11 deletions

View File

@ -388,6 +388,8 @@
</div>
<div id="container">
<div id="info">
<h1>{{ .RequestedPath }}</h1>
<h2>{{ .Now }}</h2>
<h3>At This Endpoint:</h3>

View File

@ -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()