Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing slash at the end of identity server #1898

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
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