Explorar o código

Return empty rawIspInfo when no ISP info is obtained

Maddie Zhan %!s(int64=5) %!d(string=hai) anos
pai
achega
73318e153b
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      web/web.go

+ 3 - 0
web/web.go

@@ -179,6 +179,9 @@ func getIP(w http.ResponseWriter, r *http.Request) {
 		}
 
 		ret.ProcessedString += " - " + isp
+	} else {
+		// return an empty JSON object to avoid parse errors
+		ret.RawISPInfo = "{}"
 	}
 
 	render.JSON(w, r, ret)