avoid failing scheme check

This commit is contained in:
Stephen Birarda 2017-01-23 16:46:59 -08:00
parent 7362bf16c1
commit 9229a07f6a

View file

@ -965,15 +965,9 @@ int EntityTree::processEditPacketData(ReceivedMessage& message, const unsigned c
for (const auto& whiteListedPrefix : _entityScriptSourceWhitelist) {
auto whiteListURL = QUrl::fromUserInput(whiteListedPrefix);
if (entityScriptURL.scheme() != whiteListURL.scheme()) {
// isParentOf will be false if the schemes are different, but
}
qDebug() << "Comparing" << entityScriptURL << "to" << whiteListURL;
qDebug() << whiteListURL.isParentOf(entityScriptURL);
// check if this script URL matches the whitelist domain and, optionally, is beneath the path
if (whiteListURL.isParentOf(entityScriptURL)) {
if (entityScriptURL.host().compare(whiteListURL.host(), Qt::CaseInsensitive) == 0 &&
entityScriptURL.path().startsWith(whiteListURL.path(), Qt::CaseInsensitive)) {
passedWhiteList = true;
break;
}