mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-11 00:44:15 +02:00
[wgem] handling upper case icon link rel
This commit is contained in:
@@ -81,12 +81,14 @@ class WebApplicationManager(SoftwareManager):
|
||||
return name
|
||||
|
||||
def _get_app_icon_url(self, url: str, soup: BeautifulSoup) -> str:
|
||||
icon_tag = soup.head.find('link', attrs={"rel": "icon"})
|
||||
for rel in ('icon', 'ICON'):
|
||||
icon_tag = soup.head.find('link', attrs={"rel": rel})
|
||||
icon_url = icon_tag.get('href') if icon_tag else None
|
||||
|
||||
if icon_url and not icon_url.startswith('http'):
|
||||
icon_url = url + (icon_url if icon_url.startswith('/') else '/{}'.format(icon_url))
|
||||
|
||||
if icon_url:
|
||||
return icon_url
|
||||
|
||||
def _get_fix_for(self, url_no_protocol: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user