From 254b675f2c98451afc678234493f1360e4a989ab Mon Sep 17 00:00:00 2001 From: Elara Musayelyan Date: Wed, 28 Jun 2023 21:53:00 -0700 Subject: [PATCH] Fix invalid user agent error --- weather.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weather.go b/weather.go index ba11f69..e6c4a3f 100644 --- a/weather.go +++ b/weather.go @@ -259,7 +259,7 @@ func getWeather(ctx context.Context, lat, lon float64) (*METResponse, error) { } // Set identifying user agent as per NMI requirements - req.Header.Set("User-Agent", fmt.Sprintf("ITD/%s gitea.arsenm.dev/Arsen6331/itd", version)) + req.Header.Set("User-Agent", fmt.Sprintf("ITD/%s gitea.arsenm.dev/Arsen6331/itd", strings.TrimSpace(version))) // Perform request res, err := http.DefaultClient.Do(req)