History

check for HTTPS scheme in bearer add in XMLHttpRequest

Stephen Birarda committed 10 years ago

Commit 81cb3351 parent a45677c1 file · +1 −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+1−1
@@ -143,7 +143,7 @@ void XMLHttpRequestClass::open(const QString& method, const QString& url, bool a · 142 unmodified lines
143 if (url.toLower().left(METAVERSE_API_URL.length()) == METAVERSE_API_URL) {143 if (url.toLower().left(METAVERSE_API_URL.length()) == METAVERSE_API_URL) {
144 auto accountManager = DependencyManager::get<AccountManager>();144 auto accountManager = DependencyManager::get<AccountManager>();
145 145
146 if (accountManager->hasValidAccessToken()) {146 if (_url.scheme() == "https" && accountManager->hasValidAccessToken()) {
147 static const QString HTTP_AUTHORIZATION_HEADER = "Authorization";147 static const QString HTTP_AUTHORIZATION_HEADER = "Authorization";
148 QString bearerString = "Bearer " + accountManager->getAccountInfo().getAccessToken().token;148 QString bearerString = "Bearer " + accountManager->getAccountInfo().getAccessToken().token;
149 _request.setRawHeader(HTTP_AUTHORIZATION_HEADER.toLocal8Bit(), bearerString.toLocal8Bit());149 _request.setRawHeader(HTTP_AUTHORIZATION_HEADER.toLocal8Bit(), bearerString.toLocal8Bit());