Browse Source

Return empty rawIspInfo when no ISP info is obtained

Maddie Zhan 5 years ago
parent
commit
73318e153b
1 changed files with 3 additions and 0 deletions
  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)