diff --git a/CHANGELOG.md b/CHANGELOG.md index 51806e6..4c293ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - You can't change link selection while the page is loading +- Only one request is made for each URL - `v1.3.0` accidentally made two requests each time (#50) ## [1.3.0] - 2020-07-10 diff --git a/display/private.go b/display/private.go index 07d2837..851815d 100644 --- a/display/private.go +++ b/display/private.go @@ -255,18 +255,23 @@ func handleURL(t *tab, u string) (string, bool) { return ret("", false) } - // Make new request for downloading purposes - res, clientErr := client.Fetch(u) - if clientErr != nil && clientErr != client.ErrTofu { - Error("URL Fetch Error", err.Error()) - return ret("", false) - } - if err == renderer.ErrTooLarge { + // Make new request for downloading purposes + res, clientErr := client.Fetch(u) + if clientErr != nil && clientErr != client.ErrTofu { + Error("URL Fetch Error", err.Error()) + return ret("", false) + } go dlChoice("That page is too large. What would you like to do?", u, res) return ret("", false) } if err == renderer.ErrTimedOut { + // Make new request for downloading purposes + res, clientErr := client.Fetch(u) + if clientErr != nil && clientErr != client.ErrTofu { + Error("URL Fetch Error", err.Error()) + return ret("", false) + } go dlChoice("Loading that page timed out. What would you like to do?", u, res) return ret("", false) }