Showing the changes to libraries/script-engine/src/XMLHttpRequestClass.cpp (1 of 1 file). Show all
Unified · Split
| @@ -144,12 +144,12 @@ void XMLHttpRequestClass::open(const QString& method, const QString& url, bool a · 143 unmodified lines | ||
| 144 | 144 | auto accountManager = DependencyManager::get<AccountManager>(); |
| 145 | 145 | |
| 146 | 146 | if (accountManager->hasValidAccessToken()) { |
| 147 | − QUrlQuery urlQuery(_url.query()); | |
| 148 | − urlQuery.addQueryItem("access_token", accountManager->getAccountInfo().getAccessToken().token); | |
| 149 | − _url.setQuery(urlQuery); | |
| 147 | + static const QString HTTP_AUTHORIZATION_HEADER = "Authorization"; | |
| 148 | + QString bearerString = "Bearer " + accountManager->getAccountInfo().getAccessToken().token; | |
| 149 | + _request.setRawHeader(HTTP_AUTHORIZATION_HEADER.toLocal8Bit(), bearerString.toLocal8Bit()); | |
| 150 | 150 | } |
| 151 | − | |
| 152 | 151 | } |
| 152 | + | |
| 153 | 153 | if (!username.isEmpty()) { |
| 154 | 154 | _url.setUserName(username); |
| 155 | 155 | } |