Skip to content

Commit

Permalink
Remove trailing slash at the end of identity server.
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Buquet <[email protected]>
  • Loading branch information
NicolasBuquet committed Jan 14, 2025
1 parent 30c8bfd commit 63d45f8
Showing 1 changed file with 9 additions and 0 deletions.
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.
// Ths 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 lead to error 500 for these calls.
// Sp, 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

0 comments on commit 63d45f8

Please sign in to comment.