mirror of
https://github.com/overte-org/overte.git
synced 2025-06-19 10:20:23 +02:00
Merge pull request #4524 from ctrlaltdavid/fix-xmlhttprequest-auth
Fix authorization of API calls in XMLHttpRequest
This commit is contained in:
commit
80ecbed02b
1 changed files with 3 additions and 1 deletions
|
@ -22,6 +22,8 @@
|
||||||
#include "XMLHttpRequestClass.h"
|
#include "XMLHttpRequestClass.h"
|
||||||
#include "ScriptEngine.h"
|
#include "ScriptEngine.h"
|
||||||
|
|
||||||
|
const QString METAVERSE_API_URL = "https://metaverse.highfidelity.com/api/";
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QByteArray*)
|
Q_DECLARE_METATYPE(QByteArray*)
|
||||||
|
|
||||||
XMLHttpRequestClass::XMLHttpRequestClass(QScriptEngine* engine) :
|
XMLHttpRequestClass::XMLHttpRequestClass(QScriptEngine* engine) :
|
||||||
|
@ -207,7 +209,7 @@ void XMLHttpRequestClass::open(const QString& method, const QString& url, bool a
|
||||||
notImplemented();
|
notImplemented();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (url.toLower().left(33) == "https://metaverse.highfidelity.com/api/") {
|
if (url.toLower().left(METAVERSE_API_URL.length()) == METAVERSE_API_URL) {
|
||||||
AccountManager& accountManager = AccountManager::getInstance();
|
AccountManager& accountManager = AccountManager::getInstance();
|
||||||
|
|
||||||
if (accountManager.hasValidAccessToken()) {
|
if (accountManager.hasValidAccessToken()) {
|
||||||
|
|
Loading…
Reference in a new issue