mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 03:26:05 -04:00
Workaroud the contentType handling of QTWebEngine.
It seems that QTWebEngine doesn't correctly handle a "complex" mimeType (`text/html; charset=utf-8`). In this case, it handles the content as `plain/text`. So let pass only the first part of the full mimeType without the charset. Fix #50
This commit is contained in:
parent
963c0066c2
commit
a478b1600c
@ -47,6 +47,7 @@ UrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *request)
|
||||
}
|
||||
BlobBuffer* buffer = new BlobBuffer(entry.getBlob());
|
||||
auto mimeType = QByteArray::fromStdString(entry.getMimetype());
|
||||
mimeType = mimeType.split(';')[0];
|
||||
connect(buffer, &QIODevice::aboutToClose, buffer, &QObject::deleteLater);
|
||||
request->reply(mimeType, buffer);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user