You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-16 09:42:23 +03:00
Only use the first 3 viaServers specified (#5034)
* Only use the first 3 viaServers specified To avoid HTTP 414 URI Too Long error Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b3d217717a
commit
a03cf054a8
@@ -2391,8 +2391,8 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
||||
const queryParams: QueryDict = {};
|
||||
if (opts.viaServers) {
|
||||
// server_name has been deprecated in favour of via with Matrix >1.11 (MSC4156)
|
||||
queryParams.server_name = opts.viaServers;
|
||||
queryParams.via = opts.viaServers;
|
||||
// We only use the first 3 servers, to avoid URI length issues.
|
||||
queryParams.via = queryParams.server_name = opts.viaServers.slice(0, 3);
|
||||
}
|
||||
|
||||
const data: IJoinRequestBody = {};
|
||||
@@ -2436,9 +2436,11 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
||||
|
||||
const queryParams: QueryDict = {};
|
||||
if (opts.viaServers) {
|
||||
// We only use the first 3 servers, to avoid URI length issues.
|
||||
const viaServers = Array.isArray(opts.viaServers) ? opts.viaServers.slice(0, 3) : [opts.viaServers];
|
||||
// server_name has been deprecated in favour of via with Matrix >1.11 (MSC4156)
|
||||
queryParams.server_name = opts.viaServers;
|
||||
queryParams.via = opts.viaServers;
|
||||
queryParams.server_name = viaServers;
|
||||
queryParams.via = viaServers;
|
||||
}
|
||||
|
||||
const body: Record<string, string> = {};
|
||||
|
||||
Reference in New Issue
Block a user