1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Merge pull request #478 from krombel/access_token_header

Use access-token in header
This commit is contained in:
Kegsay
2017-07-06 13:44:31 +01:00
committed by GitHub
5 changed files with 43 additions and 9 deletions

View File

@@ -54,6 +54,8 @@ const utils = require("./utils");
* to all requests with this client. Useful for application services which require
* <code>?user_id=</code>.
*
* @param {boolean} [opts.useAuthorizationHeader = false] Set to true to use
* Authorization header instead of query param to send the access token to the server.
*/
function MatrixBaseApis(opts) {
utils.checkObjectHasKeys(opts, ["baseUrl", "request"]);
@@ -70,6 +72,7 @@ function MatrixBaseApis(opts) {
onlyData: true,
extraParams: opts.queryParams,
localTimeoutMs: opts.localTimeoutMs,
useAuthorizationHeader: opts.useAuthorizationHeader,
};
this._http = new httpApi.MatrixHttpApi(this, httpOpts);