You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
implement usage of Authorization-Header instead of query-param for access_token
This commit is contained in:
@@ -385,8 +385,20 @@ module.exports.MatrixHttpApi.prototype = {
|
|||||||
if (!queryParams) {
|
if (!queryParams) {
|
||||||
queryParams = {};
|
queryParams = {};
|
||||||
}
|
}
|
||||||
if (!queryParams.access_token) {
|
if (isFinite(opts)) {
|
||||||
queryParams.access_token = this.opts.accessToken;
|
// opts used to be localTimeoutMs
|
||||||
|
opts = {
|
||||||
|
localTimeoutMs: opts,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (!opts) {
|
||||||
|
opts = {};
|
||||||
|
}
|
||||||
|
if (!opts.headers) {
|
||||||
|
opts.headers = {};
|
||||||
|
}
|
||||||
|
if (!opts.headers.Authorization) {
|
||||||
|
opts.headers.Authorization = "Bearer " + this.opts.accessToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
const request_promise = this.request(
|
const request_promise = this.request(
|
||||||
|
|||||||
Reference in New Issue
Block a user