From 9d507dcaac698254b6b0b7238c5e476a6ecdda78 Mon Sep 17 00:00:00 2001 From: Adnan Maolood Date: Fri, 15 Jan 2021 15:36:39 +0000 Subject: [PATCH] Update go-gemini dependency Version 0.1.12 fixes a bug where the client Timeout was not applied when dialing, causing the client to hang when a host was down. --- go.mod | 2 +- go.sum | 4 ++-- main.go | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 594da58..aa9941c 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module git.sr.ht/~sircmpwn/kineto go 1.15 require ( - git.sr.ht/~adnano/go-gemini v0.1.6 + git.sr.ht/~adnano/go-gemini v0.1.12 git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3 ) diff --git a/go.sum b/go.sum index 609ab52..9c7831b 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.sr.ht/~adnano/go-gemini v0.1.6 h1:nc13BMKnrHSWnR55DkaffsAe6Ik7nqwrq31Be1/0T0k= -git.sr.ht/~adnano/go-gemini v0.1.6/go.mod h1:If1VxEWcZDrRt5FeAFnGTcM2Ud1E3BXs3VJ5rnZWKq0= +git.sr.ht/~adnano/go-gemini v0.1.12 h1:zuNZ8ur7GO246YU1Lrl4beuSJ84A8RwmlGaNdXfbUWc= +git.sr.ht/~adnano/go-gemini v0.1.12/go.mod h1:If1VxEWcZDrRt5FeAFnGTcM2Ud1E3BXs3VJ5rnZWKq0= git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3 h1:4wDp4BKF7NQqoh73VXpZsB/t1OEhDpz/zEpmdQfbjDk= git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= diff --git a/main.go b/main.go index 0d4dad6..09ee99b 100644 --- a/main.go +++ b/main.go @@ -382,8 +382,7 @@ type GemtextHeading struct { func proxyGemini(req gemini.Request, external bool, root *url.URL, w http.ResponseWriter, r *http.Request) { client := gemini.Client{ - Timeout: 30 * time.Second, - InsecureSkipTrust: true, + Timeout: 30 * time.Second, } if h := (url.URL{Host: req.Host}); h.Port() == "" { @@ -529,7 +528,7 @@ func main() { w.WriteHeader(http.StatusBadRequest) w.Write([]byte("Bad request")) } else { - w.Header().Add("Location", "?" + q[0]) + w.Header().Add("Location", "?"+q[0]) w.WriteHeader(http.StatusFound) w.Write([]byte("Redirecting")) }