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

Merge pull request #1009 from matrix-org/jryans/user-settings-toggle-3pid

Add API for bulk lookup on the Identity Server
This commit is contained in:
J. Ryan Stinnett
2019-08-07 18:05:58 +01:00
committed by GitHub
2 changed files with 46 additions and 4 deletions

View File

@@ -396,16 +396,19 @@ module.exports.MatrixHttpApi.prototype = {
withCredentials: false,
json: false,
_matrix_opts: this.opts,
headers: {},
};
if (method == 'GET') {
opts.qs = params;
} else {
} else if (typeof params === "object") {
opts.form = params;
} else if (typeof params === "string") {
// Assume the caller has serialised the body to JSON
opts.body = params;
opts.headers['Content-Type'] = "application/json";
}
if (accessToken) {
opts.headers = {
Authorization: `Bearer ${accessToken}`,
};
opts.headers['Authorization'] = `Bearer ${accessToken}`;
}
const defer = Promise.defer();