Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions MatrixSDK/MXSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,15 @@ - (void)handleSyncResponse:(MXSyncResponse *)syncResponse

- (void)setIdentityServer:(NSString *)identityServer andAccessToken:(NSString *)accessToken
{
// Old Account data can have a trailing slash at the end of their Identity Server.
// This can lead to unrecognized URL on the backend (like on 'invite to room') because the URL is then constructed
// with a double slash in its path.
// This leads to error 500 for these calls.
// So, fix this trailing slash as soon as we receive it.
if ([identityServer hasSuffix:@"/"]) {
identityServer = [identityServer substringToIndex:identityServer.length-1];
}

MXLogDebug(@"[MXSession] setIdentityServer: %@", identityServer);

matrixRestClient.identityServer = identityServer;
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-1898.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove trailing slash at the end of identity server.
Loading