History

Extract API URL into a const

David Rowe committed 11 years ago

Commit c4567601 parent 1ee797e1 file · +3 −1Browse files

Showing the changes to libraries/script-engine/src/XMLHttpRequestClass.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/XMLHttpRequestClass.cpp+3−1
@@ -22,6 +22,8 @@ · 21 unmodified lines
22#include "XMLHttpRequestClass.h"22#include "XMLHttpRequestClass.h"
23#include "ScriptEngine.h"23#include "ScriptEngine.h"
24 24
25const QString METAVERSE_API_URL = "https://metaverse.highfidelity.com/api/";
26
25Q_DECLARE_METATYPE(QByteArray*)27Q_DECLARE_METATYPE(QByteArray*)
26 28
27XMLHttpRequestClass::XMLHttpRequestClass(QScriptEngine* engine) :29XMLHttpRequestClass::XMLHttpRequestClass(QScriptEngine* engine) :
@@ -207,7 +209,7 @@ void XMLHttpRequestClass::open(const QString& method, const QString& url, bool a · 179 unmodified lines
207 notImplemented();209 notImplemented();
208 }210 }
209 } else {211 } else {
210 if (url.toLower().left(39) == "https://metaverse.highfidelity.com/api/") {212 if (url.toLower().left(METAVERSE_API_URL.length()) == METAVERSE_API_URL) {
211 AccountManager& accountManager = AccountManager::getInstance();213 AccountManager& accountManager = AccountManager::getInstance();
212 214
213 if (accountManager.hasValidAccessToken()) {215 if (accountManager.hasValidAccessToken()) {