Include both IPv4 and IPv6 links

This commit is contained in:
Ian Bishop
2016-03-09 08:55:41 +10:00
parent 2b340fc2ec
commit 4cfccfdcaf
2 changed files with 5 additions and 10 deletions

View File

@ -141,19 +141,12 @@ func (a *API) DefaultHandler(w http.ResponseWriter, r *http.Request) *appError {
return internalServerError(err)
}
IsV6 := true
ip := net.ParseIP(r.Header.Get(IP_HEADER))
if ip.To4() != nil {
IsV6 = false
}
var data = struct {
IP string
IsV6 bool
JSON string
Header http.Header
Cmd
}{ip.String(), IsV6, string(b), r.Header, cmd}
}{r.Header.Get(IP_HEADER), string(b), r.Header, cmd}
if err := t.Execute(w, &data); err != nil {
return internalServerError(err)