mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 13:18:26 +02:00
Merge pull request #16511 from howard-stearns/fix-lookupurl-helper-regex
fix handleUrl helper regex
This commit is contained in:
commit
854d84912e
1 changed files with 6 additions and 3 deletions
|
@ -242,7 +242,10 @@ bool AddressManager::handleUrl(const QUrl& lookupUrlIn, LookupTrigger trigger) {
|
||||||
|
|
||||||
QUrl lookupUrl = lookupUrlIn;
|
QUrl lookupUrl = lookupUrlIn;
|
||||||
|
|
||||||
qCDebug(networking) << "Trying to go to URL" << lookupUrl.toString();
|
if (!lookupUrl.host().isEmpty() && !lookupUrl.path().isEmpty()) {
|
||||||
|
// Assignment clients ping for empty url until assigned. Don't spam.
|
||||||
|
qCDebug(networking) << "Trying to go to URL" << lookupUrl.toString();
|
||||||
|
}
|
||||||
|
|
||||||
if (lookupUrl.scheme().isEmpty() && !lookupUrl.path().startsWith("/")) {
|
if (lookupUrl.scheme().isEmpty() && !lookupUrl.path().startsWith("/")) {
|
||||||
// 'urls' without schemes are taken as domain names, as opposed to
|
// 'urls' without schemes are taken as domain names, as opposed to
|
||||||
|
@ -263,8 +266,8 @@ bool AddressManager::handleUrl(const QUrl& lookupUrlIn, LookupTrigger trigger) {
|
||||||
if (lookupUrl.scheme() == URL_SCHEME_HIFI) {
|
if (lookupUrl.scheme() == URL_SCHEME_HIFI) {
|
||||||
if (lookupUrl.host().isEmpty()) {
|
if (lookupUrl.host().isEmpty()) {
|
||||||
// this was in the form hifi:/somewhere or hifi:somewhere. Fix it by making it hifi://somewhere
|
// this was in the form hifi:/somewhere or hifi:somewhere. Fix it by making it hifi://somewhere
|
||||||
static const QRegExp HIFI_SCHEME_REGEX = QRegExp(URL_SCHEME_HIFI + ":\\/?", Qt::CaseInsensitive);
|
static const QRegExp HIFI_SCHEME_REGEX = QRegExp(URL_SCHEME_HIFI + ":\\/?($|\\w+)", Qt::CaseInsensitive);
|
||||||
lookupUrl = QUrl(lookupUrl.toString().replace(HIFI_SCHEME_REGEX, URL_SCHEME_HIFI + "://"));
|
lookupUrl = QUrl(lookupUrl.toString().replace(HIFI_SCHEME_REGEX, URL_SCHEME_HIFI + "://\\1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::LookupAddress);
|
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::LookupAddress);
|
||||||
|
|
Loading…
Reference in a new issue