mirror of
https://github.com/librespeed/speedtest.git
synced 2026-08-03 22:28:24 +00:00
Assign empty object for ISP info when not available
If somehow in the telemetry data ISP info is empty, write an empty JSON object as ISP info into the database to avoid parsing errors
This commit is contained in:
parent
0aed498a58
commit
687a5aeca0
1 changed files with 5 additions and 1 deletions
|
|
@ -166,7 +166,11 @@ func Record(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
var record schema.TelemetryData
|
||||
record.IPAddress = ipAddr
|
||||
record.ISPInfo = ispInfo
|
||||
if ispInfo == "" {
|
||||
record.ISPInfo = "{}"
|
||||
} else {
|
||||
record.ISPInfo = ispInfo
|
||||
}
|
||||
record.Extra = extra
|
||||
record.UserAgent = userAgent
|
||||
record.Language = language
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue