mirror of
https://github.com/zealdocs/zeal.git
synced 2024-08-17 02:00:25 +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;
|
||||
}
|
||||
|
||||
bool isFirstPartyUrlLocal = Core::NetworkAccessManager::isLocalUrl(firstPartyUrl);
|
||||
bool isRequestUrlLocal = Core::NetworkAccessManager::isLocalUrl(requestUrl);
|
||||
|
||||
// Direct links are controlled in the WebPage
|
||||
if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame) {
|
||||
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.
|
||||
if (isFirstPartyUrlLocal == isRequestUrlLocal) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user