Make sure absolutisation of https links works correctly!
This commit is contained in:
parent
1b7da02def
commit
3562a6db25
10
av98.py
10
av98.py
|
@ -139,9 +139,15 @@ class GeminiItem():
|
||||||
GeminiItem as a base.
|
GeminiItem as a base.
|
||||||
"""
|
"""
|
||||||
# Absolutise URL, which annoyingly needs a valid scheme...
|
# Absolutise URL, which annoyingly needs a valid scheme...
|
||||||
base_url = self.url.replace("gemini://", "https://")
|
if self.url.startswith("gemini://"):
|
||||||
|
base_url = self.url.replace("gemini://", "https://")
|
||||||
|
was_gemini = True
|
||||||
|
else:
|
||||||
|
base_url = self.url
|
||||||
|
was_gemini = False
|
||||||
absolute = urllib.parse.urljoin(base_url, relative_url)
|
absolute = urllib.parse.urljoin(base_url, relative_url)
|
||||||
absolute = absolute.replace("https://", "gemini://")
|
if was_gemini:
|
||||||
|
absolute = absolute.replace("https://", "gemini://")
|
||||||
return absolute
|
return absolute
|
||||||
|
|
||||||
def to_map_line(self, name=None):
|
def to_map_line(self, name=None):
|
||||||
|
|
Loading…
Reference in New Issue