fix(browser): handle blob URL scheme for Qt older than 5.12

Add a special check for blob: resources in URL request interceptor.

Fixes #1376.
This commit is contained in:
Oleg Shparber 2023-09-17 03:36:10 -04:00
parent dcf6016bb8
commit 9d376c25f7

View File

@ -41,6 +41,13 @@ void UrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
const QUrl requestUrl = info.requestUrl();
const QUrl firstPartyUrl = info.firstPartyUrl();
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
// Workaround for https://github.com/zealdocs/zeal/issues/1376. Fixed in Qt 5.12.0.
if (!firstPartyUrl.isValid() && requestUrl.scheme() == QLatin1String("blob")) {
return;
}
#endif
// Block invalid requests.
if (!requestUrl.isValid() || !firstPartyUrl.isValid()) {
blockRequest(info);