From 6c52299c7af25c5502f91cf7a1e78648453e5eda Mon Sep 17 00:00:00 2001 From: sloumdrone Date: Fri, 27 Sep 2019 19:19:23 -0700 Subject: [PATCH] Fixes a few logical issues and order of op --- client.go | 2 +- gemini/gemini.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 05bee18..241bbc4 100644 --- a/client.go +++ b/client.go @@ -833,12 +833,12 @@ func (c *client) Visit(url string) { } case "gemini": capsule, err := gemini.Visit(u.Host, u.Port, u.Resource, &c.Certs) - go saveConfig() if err != nil { c.SetMessage(err.Error(), true) c.DrawMessage() return } + go saveConfig() switch capsule.Status { case 1: c.search("", u.Full, capsule.Content) diff --git a/gemini/gemini.go b/gemini/gemini.go index adce235..4e03492 100644 --- a/gemini/gemini.go +++ b/gemini/gemini.go @@ -113,7 +113,7 @@ func Retrieve(host, port, resource string, td *TofuDigest) (string, error) { // the hostname on the certificate(s) from the server // is the hostname we have requested connState := conn.ConnectionState() - if len(connState.PeerCertificates) < 0 { + if len(connState.PeerCertificates) < 1 { return "", fmt.Errorf("Insecure, no certificates offered by server") } hostCertExists := td.Exists(host)