mirror of https://github.com/mpolden/echoip
Fix indention
This commit is contained in:
parent
f77fb4fbc0
commit
b6acdacddd
|
@ -60,7 +60,6 @@ func ipFromRequest(header string, r *http.Request) (net.IP, error) {
|
|||
if ip != nil {
|
||||
remoteIP = ip.String()
|
||||
}
|
||||
fmt.Printf("IP: %v\n", ip)
|
||||
}
|
||||
if remoteIP == "" {
|
||||
host, _, err := net.SplitHostPort(r.RemoteAddr)
|
||||
|
@ -68,7 +67,6 @@ func ipFromRequest(header string, r *http.Request) (net.IP, error) {
|
|||
}
|
||||
remoteIP = host
|
||||
}
|
||||
fmt.Printf("Remote: %v\n", remoteIP)
|
||||
ip := net.ParseIP(remoteIP)
|
||||
if ip == nil {
|
||||
return nil, fmt.Errorf("could not parse IP: %s", remoteIP)
|
||||
|
@ -90,7 +88,7 @@ func (s *Server) newResponse(r *http.Request) (Response, error) {
|
|||
hostname, _ = s.LookupAddr(ip)
|
||||
}
|
||||
var autonomousSystemNumber string
|
||||
if(asn.AutonomousSystemNumber > 0) {
|
||||
if asn.AutonomousSystemNumber > 0 {
|
||||
autonomousSystemNumber = "AS" + strconv.FormatUint(uint64(asn.AutonomousSystemNumber), 10);
|
||||
}
|
||||
return Response{
|
||||
|
@ -280,7 +278,6 @@ func (s *Server) Handler() http.Handler {
|
|||
// JSON
|
||||
r.Route("GET", "/", s.JSONHandler).Header("Accept", jsonMediaType)
|
||||
r.Route("GET", "/json", s.JSONHandler)
|
||||
|
||||
r.RoutePrefix("GET", "/json/", s.JSONHandler)
|
||||
|
||||
// CLI
|
||||
|
|
Loading…
Reference in New Issue