mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 12:34:19 +00:00
- Display favicon in Web UI
This commit is contained in:
parent
93c644da88
commit
2707aa2818
@ -140,6 +140,21 @@ void HttpConnection::respond()
|
||||
return;
|
||||
}
|
||||
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);
|
||||
if (list.contains(".") || list.contains(".."))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user