]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - rounds/gemini.go
Trim excess newline in gemini-related logs
[tofuproxy.git] / 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)