Merge pull request #296 from kasenvr/fix/qml-whitelist-default

Add community-apps repo to default QML whitelist.
This commit is contained in:
kasenvr 2020-05-19 16:49:29 -04:00 committed by GitHub
commit 22e9aec0dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3167,7 +3167,7 @@ void Application::showLoginScreen() {
#endif
}
static const QUrl AUTHORIZED_EXTERNAL_QML_SOURCE { "https://content.highfidelity.com/Experiences/Releases" };
static const QUrl AUTHORIZED_EXTERNAL_QML_SOURCE { "https://cdn.vircadia.com/community-apps/applications" };
void Application::initializeUi() {
@ -3186,14 +3186,16 @@ void Application::initializeUi() {
safeURLS += settingsSafeURLS;
// END PULL SAFEURLS FROM INTERFACE.JSON Settings
bool isInWhitelist = false; // assume unsafe
for (const auto& str : safeURLS) {
if (!str.isEmpty() && str.endsWith(".qml") && url.toString().endsWith(".qml") &&
url.toString().startsWith(str)) {
qCDebug(interfaceapp) << "Found matching url!" << url.host();
isInWhitelist = true;
return true;
if (AUTHORIZED_EXTERNAL_QML_SOURCE.isParentOf(url)) {
return true;
} else {
for (const auto& str : safeURLS) {
if (!str.isEmpty() && str.endsWith(".qml") && url.toString().endsWith(".qml") &&
url.toString().startsWith(str)) {
qCDebug(interfaceapp) << "Found matching url!" << url.host();
return true;
}
}
}