Add a URL that preserves the URL path when trying to resolve favicons. (#8565)

This commit is contained in:
Patrick Klein 2022-10-20 02:50:17 +02:00 committed by GitHub
parent e180980b90
commit 1d00c22244
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 5 deletions

View file

@ -130,6 +130,13 @@ void IconDownloader::setUrl(const QString& entryUrl)
}
}
// Add a pull that preserves the query if there is one.
if (!url.path().isEmpty()) {
// Appends /favicon.ico to the last segment of the path.
// stem/something/ will become stem/something/favicon.ico, and stem/something will become stem/favicon.ico
m_urlsToTry.append(url.resolved(QUrl("./favicon.ico")));
}
// Add a direct pull of the website's own favicon.ico file
QUrl favicon_url = url;
favicon_url.setPath("/favicon.ico");