History

Make XMLHttpRequest automatically authorize API calls

David Rowe committed 12 years ago

Commit 83a868d1 parent 573ce721 file · +4 −0Browse 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+4−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717
1818 #include <NetworkAccessManager.h>
1919
20+#include <AccountManager.h>
2021 #include "XMLHttpRequestClass.h"
2122 #include "ScriptEngine.h"
2223
@@ -201,6 +202,9 @@ void XMLHttpRequestClass::open(const QString& method, const QString& url, bool a · 178 unmodified lines
201202 notImplemented();
202203 }
203204 } else {
205+ if (url.toLower().left(33) == "https://data.highfidelity.io/api/") {
206+ _url.setQuery("access_token=" + AccountManager::getInstance().getAccountInfo().getAccessToken().token);
207+ }
204208 if (!username.isEmpty()) {
205209 _url.setUserName(username);
206210 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t