From 916ed3a0d4a037f802ced0d8f43f53d8d6cea132 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 21 Mar 2018 16:18:31 -0700 Subject: [PATCH] review --- interface/src/Application.cpp | 3 +-- libraries/networking/src/AddressManager.cpp | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 7641bb6c32..9d1e00f8af 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -518,12 +518,11 @@ bool isDomainURL(QUrl url) { if (url.scheme() == URL_SCHEME_HIFI) { return true; } - if (url.scheme() != URL_SCHEME_FILE + if (url.scheme() != URL_SCHEME_FILE) { // TODO -- once Octree::readFromURL no-longer takes over the main event-loop, serverless-domain urls can // be loaded over http(s) // && url.scheme() != URL_SCHEME_HTTP && // url.scheme() != URL_SCHEME_HTTPS - ) { return false; } if (url.path().endsWith(".json", Qt::CaseInsensitive) || diff --git a/libraries/networking/src/AddressManager.cpp b/libraries/networking/src/AddressManager.cpp index 7d33cb939c..d8be69b492 100644 --- a/libraries/networking/src/AddressManager.cpp +++ b/libraries/networking/src/AddressManager.cpp @@ -133,14 +133,14 @@ void AddressManager::storeCurrentAddress() { auto url = currentAddress(); if (url.scheme() == URL_SCHEME_FILE || + (url.scheme() == URL_SCHEME_HIFI && !url.host().isEmpty())) { // TODO -- once Octree::readFromURL no-longer takes over the main event-loop, serverless-domain urls can // be loaded over http(s) // url.scheme() == URL_SCHEME_HTTP || // url.scheme() == URL_SCHEME_HTTPS || - !url.host().isEmpty()) { currentAddressHandle.set(url); } else { - qCWarning(networking) << "Ignoring attempt to save current address with an empty host" << url; + qCWarning(networking) << "Ignoring attempt to save current address with an invalid url:" << url; } } @@ -307,7 +307,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) { bool isPossiblePlaceName(QString possiblePlaceName) { bool result { false }; int length = possiblePlaceName.length(); - static const int MINIMUM_PLACENAME_LENGTH = 2; + static const int MINIMUM_PLACENAME_LENGTH = 1; static const int MAXIMUM_PLACENAME_LENGTH = 64; if (possiblePlaceName.toLower() != "localhost" && length >= MINIMUM_PLACENAME_LENGTH && length <= MAXIMUM_PLACENAME_LENGTH) {