Commit 0fe8f1cb authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify url

parent b458546b
Pipeline #55541 canceled with stage
in 16 minutes and 54 seconds
...@@ -22,18 +22,19 @@ LoadExternalReferencesUrlInterceptor::~LoadExternalReferencesUrlInterceptor() ...@@ -22,18 +22,19 @@ LoadExternalReferencesUrlInterceptor::~LoadExternalReferencesUrlInterceptor()
bool LoadExternalReferencesUrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info) bool LoadExternalReferencesUrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
{ {
const QString scheme = info.requestUrl().scheme(); const QUrl requestUrl = info.requestUrl();
const QString scheme = requestUrl.scheme();
if (scheme == QLatin1String("data") || scheme == QLatin1String("file")) { if (scheme == QLatin1String("data") || scheme == QLatin1String("file")) {
return false; return false;
} }
if (mAllowLoadExternalReference) { if (mAllowLoadExternalReference) {
if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeImage && !info.requestUrl().isLocalFile() && (scheme != QLatin1String("cid"))) { if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeImage && !requestUrl.isLocalFile() && (scheme != QLatin1String("cid"))) {
return urlIsBlocked(info.requestUrl()); return urlIsBlocked(requestUrl);
} }
return false; return false;
} else { } else {
if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeImage && !info.requestUrl().isLocalFile() && (scheme != QLatin1String("cid"))) { if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeImage && !requestUrl.isLocalFile() && (scheme != QLatin1String("cid"))) {
return urlAuthorized(info.requestUrl()); return urlAuthorized(requestUrl);
} else if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeFontResource) { } else if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeFontResource) {
return true; return true;
} else if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeStylesheet) { } else if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeStylesheet) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment