fix(favorites): Logo auch fuer Seiten, die es per JavaScript setzen
hosteurope.de liefert im HTML nur einen leeren data:-Platzhalter, das echte Symbol setzt erst JavaScript; /favicon.ico antwortet mit HTML. Die Kachel zeigte deshalb nur den Buchstaben. Scheitert das gespeicherte Symbol, fragt getIconBytes jetzt einmal den DuckDuckGo-Symboldienst - nur fuer oeffentlich erreichbare Seiten, interne Hostnamen verlassen das Haus nicht; kennt der Dienst nichts (404), bleibt es beim Buchstaben. Wirkt auch fuer bestehende Favoriten. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -497,7 +497,9 @@ export class FavoritesService {
|
||||
* Throws NotFoundException (404) if the row doesn't exist, isn't owned
|
||||
* by the caller, or has neither an uploaded icon nor a stored iconUrl.
|
||||
* Throws a 502 HttpException if the upstream fetch fails (unreachable,
|
||||
* timeout, non-image, or SSRF-blocked) -- never returns a placeholder image.
|
||||
* timeout, non-image, or SSRF-blocked) AND the public icon service fallback
|
||||
* (quick-261001-hbi, public pages only) has no icon either -- never returns
|
||||
* a placeholder image.
|
||||
*/
|
||||
async getIconBytes(
|
||||
tenantId: string,
|
||||
@@ -536,7 +538,14 @@ export class FavoritesService {
|
||||
try {
|
||||
return await this.iconDiscovery.fetchIconBytes(link.iconUrl);
|
||||
} catch {
|
||||
throw new HttpException('Icon fetch failed', HttpStatus.BAD_GATEWAY);
|
||||
// quick-261001-hbi: Seite liefert kein abrufbares Symbol (z. B. per
|
||||
// JavaScript gesetzt) -- einmal beim oeffentlichen Symbol-Dienst fragen,
|
||||
// nur fuer oeffentlich erreichbare Seiten.
|
||||
try {
|
||||
return await this.iconDiscovery.fetchPublicServiceIconBytes(link.url);
|
||||
} catch {
|
||||
throw new HttpException('Icon fetch failed', HttpStatus.BAD_GATEWAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user