default value when lookup internal ip
This commit is contained in:
1 parent
cc8449c7b3
commit
9d07639d6c
1 file changed
+4
-1
@@ -12,8 +12,11 @@ func HandleJson(c *gin.Context) {
|
||||
ipData, _, err := data.Ins().Query(ip)
|
||||
if err != nil {
|
||||
log.Err(err).Msg("Failed to query IP")
|
||||
c.String(http.StatusInternalServerError, "")
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"ip": ip,
|
||||
})
|
||||
return
|
||||
}
|
||||
ipData["ip"] = ip
|
||||
c.JSON(http.StatusOK, ipData)
|
||||
}
|
||||
Reference in new issue
Block a user