From 1c0f48e0bdeb9cfb4d9c917ce9cbb9a46a6152d4 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Mon, 29 Jan 2024 12:17:10 +0300 Subject: [PATCH] Trim excess newline in gemini-related logs --- rounds/gemini.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rounds/gemini.go b/rounds/gemini.go index b87c18a..987b62e 100644 --- a/rounds/gemini.go +++ b/rounds/gemini.go @@ -124,7 +124,7 @@ func RoundGemini( log.Printf("%s: can not read response: %+v\n", req.URL, err) return false, err } - cols := strings.SplitN(rawResp, " ", 2) + cols := strings.SplitN(strings.TrimRight(rawResp, "\r\n"), " ", 2) if len(cols) < 2 { err = fmt.Errorf("invalid response format: %s", rawResp) log.Printf("%s: %s\n", req.URL, err) -- 2.44.0