Replace inconsistent use of username with screen_name

This commit is contained in:
Sam W 2022-08-04 02:05:24 +03:00
parent b45aa84b1d
commit 6436cc2e57
2 changed files with 5 additions and 5 deletions

View File

@ -49,9 +49,9 @@ func probeTwitter(ctx context.Context, target string, registry *prometheus.Regis
} }
func twitterHandler(w http.ResponseWriter, r *http.Request) { func twitterHandler(w http.ResponseWriter, r *http.Request) {
username := r.URL.Query().Get("username") screenName := r.URL.Query().Get("screen_name")
if username == "" { if screenName == "" {
http.Error(w, "username parameter is missing", http.StatusBadRequest) http.Error(w, "screen_name parameter is missing", http.StatusBadRequest)
return return
} }
@ -60,7 +60,7 @@ func twitterHandler(w http.ResponseWriter, r *http.Request) {
ctx, cancel := context.WithTimeout(r.Context(), time.Duration(5*time.Second)) ctx, cancel := context.WithTimeout(r.Context(), time.Duration(5*time.Second))
defer cancel() defer cancel()
if success := probeTwitter(ctx, username, reg); !success { if success := probeTwitter(ctx, screenName, reg); !success {
log.Error("Probe failed!") log.Error("Probe failed!")
} }