fix favicon not matching url domain

This commit is contained in:
Tomáš Mládek 2020-06-20 19:41:16 +02:00
parent 845846c79c
commit 75a42af1be

View file

@ -100,7 +100,7 @@ class IndexView(TemplateView):
for link_tag in link_tags:
if rel in link_tag.attrs['rel']:
href = link_tag.attrs['href']
if netloc not in href:
if netloc not in href and not (href.startswith("/") or href.startswith("http")):
image = base_url + (href if href.startswith("/") else f"/{href}")
else:
image = href