]> Sergey Matveev's repositories - tofuproxy.git/commitdiff
Trim excess newline in gemini-related logs
authorSergey Matveev <stargrave@stargrave.org>
Mon, 29 Jan 2024 09:17:10 +0000 (12:17 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 29 Jan 2024 09:17:43 +0000 (12:17 +0300)
rounds/gemini.go

index b87c18a19f69a78785e73f8a5bfa05cc9f251589..987b62eb7115c8e9879a910ccd44163135a43ff6 100644 (file)
@@ -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)