add req.Host and req.Method to api handler response (#13)
This is useful information to return when (for example) testing a reverse proxy.
This commit is contained in:
committed by
Ludovic Fernandez
parent
90c7fab968
commit
2bc53608e9
6
app.go
6
app.go
@ -158,10 +158,16 @@ func api(w http.ResponseWriter, req *http.Request) {
|
|||||||
Hostname string `json:"hostname,omitempty"`
|
Hostname string `json:"hostname,omitempty"`
|
||||||
IP []string `json:"ip,omitempty"`
|
IP []string `json:"ip,omitempty"`
|
||||||
Headers http.Header `json:"headers,omitempty"`
|
Headers http.Header `json:"headers,omitempty"`
|
||||||
|
URL string `json:"url,omitempty"`
|
||||||
|
Host string `json:"host,omitempty"`
|
||||||
|
Method string `json:"method,omitempty"`
|
||||||
}{
|
}{
|
||||||
hostname,
|
hostname,
|
||||||
[]string{},
|
[]string{},
|
||||||
req.Header,
|
req.Header,
|
||||||
|
req.URL.RequestURI(),
|
||||||
|
req.Host,
|
||||||
|
req.Method,
|
||||||
}
|
}
|
||||||
|
|
||||||
ifaces, _ := net.Interfaces()
|
ifaces, _ := net.Interfaces()
|
||||||
|
Reference in New Issue
Block a user