correctly handle root favicons for non-default ports

This commit is contained in:
Athou
2026-08-02 07:26:44 +02:00
parent e404c9ce3b
commit 5d64e2f21e
2 changed files with 26 additions and 1 deletions

View File

@@ -30,7 +30,12 @@ public class RootFaviconFetcher implements FaviconFetcher {
try {
URI uri = URI.create(url.trim());
String faviconUrl = "%s://%s/favicon.ico".formatted(uri.getScheme(), uri.getHost());
String faviconUrl =
"%s://%s%s/favicon.ico"
.formatted(
uri.getScheme(),
uri.getHost(),
uri.getPort() > 0 ? ":" + uri.getPort() : "");
log.debug("getting root icon at {}", faviconUrl);
HttpResult result = getter.get(faviconUrl);