mirror of
https://github.com/zealdocs/zeal.git
synced 2024-09-11 14:25:52 +03:00
fix(browser): optimize request interceptor
This commit is contained in:
parent
e80badd0cb
commit
dcf6016bb8
@ -47,14 +47,14 @@ void UrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isFirstPartyUrlLocal = Core::NetworkAccessManager::isLocalUrl(firstPartyUrl);
|
|
||||||
bool isRequestUrlLocal = Core::NetworkAccessManager::isLocalUrl(requestUrl);
|
|
||||||
|
|
||||||
// Direct links are controlled in the WebPage
|
// Direct links are controlled in the WebPage
|
||||||
if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame) {
|
if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isFirstPartyUrlLocal = Core::NetworkAccessManager::isLocalUrl(firstPartyUrl);
|
||||||
|
bool isRequestUrlLocal = Core::NetworkAccessManager::isLocalUrl(requestUrl);
|
||||||
|
|
||||||
// Allow local resources on local pages and external resources on external pages.
|
// Allow local resources on local pages and external resources on external pages.
|
||||||
if (isFirstPartyUrlLocal == isRequestUrlLocal) {
|
if (isFirstPartyUrlLocal == isRequestUrlLocal) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user