~chrisppy/beagles

db9c98dd600085415f7a84bc1e8cc222937c8c18 — Chris Palmer 6 months ago 86dd413
update go-gemini to v0.1.16
4 files changed, 17 insertions(+), 15 deletions(-)

M config/default.go
M go.mod
M go.sum
M util/util.go
M config/default.go => config/default.go +2 -2
@@ 75,10 75,10 @@ key-commands {
#
# Example configuration:
#
# 	browser "http" {
# 	browser http {
#		navigate qutebrowser [URL]	
#	} 
# 	browser "gemini" {
# 	browser gemini {
#		navigate gmnlm [URL]	
#	} 


M go.mod => go.mod +2 -2
@@ 5,7 5,7 @@ go 1.15
replace gitlab.com/tslocum/cview v1.5.3 => git.sr.ht/~chrisppy/cview v0.0.0-20210214173831-cf2c15f351a7

require (
	git.sr.ht/~adnano/go-gemini v0.1.14
	git.sr.ht/~adnano/go-gemini v0.1.16
	git.sr.ht/~chrisppy/go-barefeed v0.1.0
	git.sr.ht/~chrisppy/go-opml v1.0.0
	git.sr.ht/~emersion/go-scfg v0.0.0-20201019143924-142a8aa629fc


@@ 21,6 21,6 @@ require (
	gitlab.com/tslocum/cbind v0.1.4
	gitlab.com/tslocum/cview v1.5.3
	go.etcd.io/bbolt v1.3.5
	golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43 // indirect
	golang.org/x/sys v0.0.0-20210223212115-eede4237b368 // indirect
	gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)

M go.sum => go.sum +4 -4
@@ 1,5 1,5 @@
git.sr.ht/~adnano/go-gemini v0.1.14 h1:05pZ6FyxrzgsG4rG/j5SmI2iu+zWVBOy+yuzB+l2dEg=
git.sr.ht/~adnano/go-gemini v0.1.14/go.mod h1:hQ75Y0i5jSFL+FQ7AzWVAYr5LQsaFC7v3ZviNyj46dY=
git.sr.ht/~adnano/go-gemini v0.1.16 h1:zCuChm4uqhumHE6Ek1UMG+OqV8nMq4aQgqWr3Yotxqs=
git.sr.ht/~adnano/go-gemini v0.1.16/go.mod h1:hQ75Y0i5jSFL+FQ7AzWVAYr5LQsaFC7v3ZviNyj46dY=
git.sr.ht/~chrisppy/cview v0.0.0-20210214173831-cf2c15f351a7 h1:OKIPsl2z9OsQDm8jnQfbwJDl0GakXJLhtBnTkbT6PW0=
git.sr.ht/~chrisppy/cview v0.0.0-20210214173831-cf2c15f351a7/go.mod h1:lCEqP/zDhBihNbyiEn59LgOCk09ejefHaS7kNZ57Nmc=
git.sr.ht/~chrisppy/go-barefeed v0.1.0 h1:kyf1sJx4uGLesiXagd4sCP9C8+TPge+y/VxFTX6dI4E=


@@ 95,8 95,8 @@ golang.org/x/sys v0.0.0-20201013132646-2da7054afaeb/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43 h1:SgQ6LNaYJU0JIuEHv9+s6EbhSCwYeAf5Yvj6lpYlqAE=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210223212115-eede4237b368 h1:fDE3p0qf2V1co1vfj3/o87Ps8Hq6QTGNxJ5Xe7xSp80=
golang.org/x/sys v0.0.0-20210223212115-eede4237b368/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=

M util/util.go => util/util.go +9 -7
@@ 19,6 19,7 @@ package util

import (
	"bytes"
	"context"
	"crypto/x509"
	"fmt"
	"io"


@@ 135,17 136,17 @@ func ParseFeed(path string, gmniPath string) (f *gofeed.Feed, err error) {
		}

		defer func() {
			if err = rsp.Body.Close(); err != nil {
			if err = rsp.Close(); err != nil {
				return
			}
		}()

		if rsp.Status != gemini.StatusSuccess {
			err = fmt.Errorf("%d for %s", rsp.Status, path)
		if rsp.Status().Class() != gemini.StatusSuccess {
			err = fmt.Errorf("%d for %s", rsp.Status().Class(), path)
			return
		}

		r = rsp.Body
		r = rsp
	default:
		var b []byte
		b, err = ioutil.ReadFile(filepath.Clean(path))


@@ 162,19 163,20 @@ func ParseFeed(path string, gmniPath string) (f *gofeed.Feed, err error) {
	return
}
func do(client *gemini.Client, req *gemini.Request, via []*gemini.Request) (*gemini.Response, error) {
	resp, err := client.Do(req)
	ctx := context.Background()
	resp, err := client.Do(ctx, req)
	if err != nil {
		return resp, err
	}

	switch gemini.StatusClass(resp.Status) {
	switch resp.Status().Class() {
	case gemini.StatusRedirect:
		via = append(via, req)
		if len(via) > 5 {
			return resp, fmt.Errorf("too many redirects")
		}

		target, err := url.Parse(resp.Meta)
		target, err := url.Parse(resp.Meta())
		if err != nil {
			return resp, err
		}