Encrypt site icon requests

Paths to favicons are now encrypted with the user's Fernet key, the same
as any other external result page element
main
Ben Busby 2023-10-11 17:17:46 -06:00
parent a7e937f7c6
commit 81b7fd1876
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1
1 changed files with 5 additions and 3 deletions

View File

@ -264,9 +264,11 @@ class Filter:
# Construct the html for inserting the icon into the parent div
parsed = urlparse.urlparse(link['href'])
src = f'{self.root_url}/{Endpoint.element}?url=' + (
f'{parsed.scheme}://{parsed.netloc}/favicon.ico'
) + '&type=image/x-icon'
favicon = self.encrypt_path(
f'{parsed.scheme}://{parsed.netloc}/favicon.ico',
is_element=True)
src = f'{self.root_url}/{Endpoint.element}?url={favicon}' + \
'&type=image/x-icon'
html = f'<img class="site-favicon" src="{src}">'
favicon = BeautifulSoup(html, 'html.parser')