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
2222 #include "XMLHttpRequestClass.h"
2323 #include "ScriptEngine.h"
2424
25+const QString METAVERSE_API_URL = "https://metaverse.highfidelity.com/api/";
26+
2527 Q_DECLARE_METATYPE(QByteArray*)
2628
2729 XMLHttpRequestClass::XMLHttpRequestClass(QScriptEngine* engine) :
@@ -207,7 +209,7 @@ void XMLHttpRequestClass::open(const QString& method, const QString& url, bool a · 179 unmodified lines
207209 notImplemented();
208210 }
209211 } else {
210− if (url.toLower().left(39) == "https://metaverse.highfidelity.com/api/") {
212+ if (url.toLower().left(METAVERSE_API_URL.length()) == METAVERSE_API_URL) {
211213 AccountManager& accountManager = AccountManager::getInstance();
212214
213215 if (accountManager.hasValidAccessToken()) {