You've already forked speedtest-go
Sync PHP backend feature parity: IP detection, database backends, API endpoints, and frontend
- IP detection: Cloudflare IPv6, ULA IPv6, proxy header chain, offline GeoIP DB - Database: add SQLite (pure Go, no CGo) and MSSQL backends - API: add JSON result sharing endpoint and ID obfuscation - Frontend: add modern CSS design, design switcher, favicon - Compatibility: ?cors parameter support, human-friendly distance rounding - Update Go to 1.21, add modernc.org/sqlite and maxminddb deps
This commit is contained in:
@@ -201,7 +201,12 @@ func Record(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := w.Write([]byte("id " + uuid.String())); err != nil {
|
||||
responseID := uuid.String()
|
||||
if config.LoadedConfig().EnableIDObfuscation {
|
||||
responseID = ObfuscateULID(uuid.String())
|
||||
}
|
||||
|
||||
if _, err := w.Write([]byte("id " + responseID)); err != nil {
|
||||
log.Errorf("Error writing ID to telemetry request: %s", err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
}
|
||||
@@ -214,7 +219,8 @@ func DrawPNG(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
uuid := r.FormValue("id")
|
||||
rawID := r.FormValue("id")
|
||||
uuid := ResolveID(rawID)
|
||||
record, err := database.DB.FetchByUUID(uuid)
|
||||
if err != nil {
|
||||
log.Errorf("Error querying database: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user