Disable cache for redirects - fixes #114

This commit is contained in:
makeworld 2020-11-04 21:11:33 -05:00
parent 277cc91881
commit b05885e710
2 changed files with 9 additions and 5 deletions

View File

@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The web browser code doesn't check for Xorg anymore, just display variables (#93)
- Bookmarks can be made to non-gemini URLs (#94)
- Remove pointless directory fallbacks (#101)
- Don't load page from cache when redirected to it (#114)
### Fixed
- XDG user dir file is parsed instead of looking for XDG env vars (#97, #100)

View File

@ -383,11 +383,14 @@ func handleURL(t *tab, u string, numRedirects int) (string, bool) {
// Gemini URL, or one with a Gemini proxy available
// Load page from cache if possible
page, ok := cache.GetPage(u)
if ok {
setPage(t, page)
return ret(u, true)
// Load page from cache if it exists,
// and this isn't a page that was redirected to by the server (indicates dynamic content)
if numRedirects == 0 {
page, ok := cache.GetPage(u)
if ok {
setPage(t, page)
return ret(u, true)
}
}
// Otherwise download it
bottomBar.SetText("Loading...")