From ca7a516f878bba8ab62ffda596ba603b26250917 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sat, 31 Jul 2021 17:20:36 -0700 Subject: changed timeout time for requests --- main.go | 8 ++++++-- static/ncatalog.html | 2 +- static/posts.html | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 76876f2..c370722 100644 --- a/main.go +++ b/main.go @@ -2590,7 +2590,7 @@ func RouteProxy(req *http.Request) (*http.Response, error) { CheckError(err, "error parsing tor proxy url") proxyTransport := &http.Transport{Proxy: http.ProxyURL(proxyUrl)} - client := &http.Client{ Transport: proxyTransport, Timeout: time.Second * 30 } + client := &http.Client{ Transport: proxyTransport, Timeout: time.Second * 10 } return client.Do(req) } @@ -2834,7 +2834,11 @@ func RouteImages(w http.ResponseWriter, media string) { CheckError(err, "error with Route Images req") - resp, err := http.DefaultClient.Do(req) + client := http.Client{ + Timeout: 5 * time.Second, + } + + resp, err := client.Do(req) if err != nil || resp.StatusCode == 404 { fileBytes, err := ioutil.ReadFile("./static/notfound.png") diff --git a/static/ncatalog.html b/static/ncatalog.html index c51a5a3..e35edd0 100644 --- a/static/ncatalog.html +++ b/static/ncatalog.html @@ -46,7 +46,7 @@