aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorFChannel <>2021-07-31 17:20:36 -0700
committerFChannel <>2021-07-31 17:20:36 -0700
commitca7a516f878bba8ab62ffda596ba603b26250917 (patch)
treebde29eb873b9a744c618d877292eb4951e6d8065 /main.go
parentc2184d6add23d9b0ca44dbbc5d026ab4f482dceb (diff)
changed timeout time for requests
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 6 insertions, 2 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")