ugly hack to fix caching for URL without / at the end

This commit is contained in:
Lionel Dricot 2021-12-07 13:08:43 +01:00
parent 25247eaa90
commit 9fb7c610bf
1 changed files with 4 additions and 1 deletions

View File

@ -153,9 +153,12 @@ class GeminiItem():
self.cache_path = os.path.expanduser(_CACHE_PATH + self.host + self.path)
# FIXME : this is a gross hack to give a name to
# index files. This will break if the index is not
# index.gmi
# index.gmi. I dont know how to know the real name
# of the file.
if self.cache_path.endswith("/"):
self.cache_path += "index.gmi"
elif not self.cache_path.endswith(".gmi"):
self.cache_path += "/index.gmi"
def root(self):
return GeminiItem(self._derive_url("/"))