commit 22d4dcaa8c27660b6845521525b1882af3cf1a20
parent f10f1fc9a0b9a8171fa69a0d206d1b2acd1f3518
Author: Natalie Pendragon <natpen@natpen.net>
Date: Tue, 19 May 2020 06:36:44 -0400
[crawl] Fix bug in relative URL parsing
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gus/lib/gemini.py b/gus/lib/gemini.py
@@ -48,7 +48,7 @@ def urlsplit_featureful(url, parent_resource=None):
# process relative link
if parent_resource is None:
return None
- joined = urljoin(parent_resource.normalized_host, url)
+ joined = urljoin("gemini://{}".format(parent_resource.normalized_host), url)
u = urlsplit(joined, 'gemini')
is_relative = True
return u, is_relative
@@ -87,7 +87,7 @@ class GeminiResource():
return None
if self._fully_qualified_url is None:
if self.is_relative:
- url = self.raw_url if not self.is_relative else self.normalized_url
+ url = self.normalized_url
else:
raw_url_lower = self.raw_url.lower()
if raw_url_lower.startswith("gemini://"):