1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-12-04 14:46:29 -05:00

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) - The web browser code doesn't check for Xorg anymore, just display variables (#93)
- Bookmarks can be made to non-gemini URLs (#94) - Bookmarks can be made to non-gemini URLs (#94)
- Remove pointless directory fallbacks (#101) - Remove pointless directory fallbacks (#101)
- Don't load page from cache when redirected to it (#114)
### Fixed ### Fixed
- XDG user dir file is parsed instead of looking for XDG env vars (#97, #100) - XDG user dir file is parsed instead of looking for XDG env vars (#97, #100)

View File

@ -383,12 +383,15 @@ func handleURL(t *tab, u string, numRedirects int) (string, bool) {
// Gemini URL, or one with a Gemini proxy available // Gemini URL, or one with a Gemini proxy available
// Load page from cache if possible // 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) page, ok := cache.GetPage(u)
if ok { if ok {
setPage(t, page) setPage(t, page)
return ret(u, true) return ret(u, true)
} }
}
// Otherwise download it // Otherwise download it
bottomBar.SetText("Loading...") bottomBar.SetText("Loading...")
t.barText = "Loading..." // Save it too, in case the tab switches during loading t.barText = "Loading..." // Save it too, in case the tab switches during loading