mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 21:42:24 +02:00
Merge pull request #14968 from davidkelly/dk/20726
Guard against accidentally calling wrong api/v1/places endpoint
This commit is contained in:
commit
badd0b8bd3
3 changed files with 10 additions and 3 deletions
|
@ -2548,7 +2548,7 @@ bool DomainServer::processPendingContent(HTTPConnection* connection, QString ite
|
|||
_pendingFileContent.seek(_pendingFileContent.size());
|
||||
_pendingFileContent.write(dataChunk);
|
||||
_pendingFileContent.close();
|
||||
|
||||
|
||||
// Respond immediately - will timeout if we wait for restore.
|
||||
connection->respond(HTTPConnection::StatusCode200);
|
||||
if (itemName == "restore-file" || itemName == "restore-file-chunk-final" || itemName == "restore-file-chunk-only") {
|
||||
|
|
|
@ -315,7 +315,9 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
|
|||
|
||||
// wasn't an address - lookup the place name
|
||||
// we may have a path that defines a relative viewpoint - pass that through the lookup so we can go to it after
|
||||
attemptPlaceNameLookup(lookupUrl.host(), lookupUrl.path(), trigger);
|
||||
if (!lookupUrl.host().isNull() && !lookupUrl.host().isEmpty()) {
|
||||
attemptPlaceNameLookup(lookupUrl.host(), lookupUrl.path(), trigger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -337,7 +339,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
|
|||
// be loaded over http(s)
|
||||
// lookupUrl.scheme() == URL_SCHEME_HTTP ||
|
||||
// lookupUrl.scheme() == HIFI_URL_SCHEME_HTTPS ||
|
||||
// TODO once a file can return a connection refusal if there were to be some kind of load error, we'd
|
||||
// TODO once a file can return a connection refusal if there were to be some kind of load error, we'd
|
||||
// need to store the previous domain tried in _lastVisitedURL. For now , do not store it.
|
||||
|
||||
_previousAPILookup.clear();
|
||||
|
|
|
@ -325,6 +325,11 @@
|
|||
leftMargin: domainNameLeftMargin
|
||||
};
|
||||
|
||||
// check to be sure we are going to look for an actual domain
|
||||
if (!domain) {
|
||||
doRequest = false;
|
||||
}
|
||||
|
||||
if (doRequest) {
|
||||
var url = Account.metaverseServerURL + '/api/v1/places/' + domain;
|
||||
request({
|
||||
|
|
Loading…
Reference in a new issue