mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Display favicon in Web UI
This commit is contained in:
parent
93c644da88
commit
2707aa2818
1 changed files with 15 additions and 0 deletions
|
@ -140,6 +140,21 @@ void HttpConnection::respond()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QString url = parser.url();
|
QString url = parser.url();
|
||||||
|
// Favicon
|
||||||
|
if(url.endsWith("favicon.ico")) {
|
||||||
|
qDebug("Returning favicon");
|
||||||
|
QFile favicon(":/Icons/skin/qbittorrent16.png");
|
||||||
|
if(favicon.open(QIODevice::ReadOnly)) {
|
||||||
|
QByteArray data = favicon.readAll();
|
||||||
|
generator.setStatusLine(200, "OK");
|
||||||
|
generator.setContentTypeByExt("png");
|
||||||
|
generator.setMessage(data);
|
||||||
|
write();
|
||||||
|
} else {
|
||||||
|
respondNotFound();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
QStringList list = url.split('/', QString::SkipEmptyParts);
|
QStringList list = url.split('/', QString::SkipEmptyParts);
|
||||||
if (list.contains(".") || list.contains(".."))
|
if (list.contains(".") || list.contains(".."))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue