Skip to content

Commit

Permalink
Don't add trailing slash when defining identityServerUrl at account c…
Browse files Browse the repository at this point in the history
…reation
  • Loading branch information
Nicolas Buquet committed Jul 21, 2023
1 parent 5bc3c48 commit f261f8f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.d/949.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IdentityServerUrl comporte un "/" terminal en fin d'URL qui pose problème
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ data class HomeServerConnectionConfig(
throw RuntimeException("Invalid homeserver URI: $hsUri")
}
// ensure trailing /
val hsString = hsUri.toString().ensureTrailingSlash()
val hsString = hsUri.toString() // .ensureTrailingSlash() // Tchap : remove
homeServerUri = try {
Uri.parse(hsString)
} catch (e: Exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,8 @@ internal class CreateRoomBodyBuilder @Inject constructor(
// This can throw an exception if identity server is not configured
ensureIdentityTokenTask.execute(Unit)

var identityServerUrlWithoutProtocol = identityStore.getIdentityServerUrlWithoutProtocol()
val identityServerUrlWithoutProtocol = identityStore.getIdentityServerUrlWithoutProtocol()
?: throw IdentityServiceError.NoIdentityServerConfigured
// Tchap : remove last char if it is a '/' else server will respond with a 500 error.
if (identityServerUrlWithoutProtocol.endsWith(char = '/')) {
identityServerUrlWithoutProtocol = identityServerUrlWithoutProtocol.dropLast(1)
}
val identityServerAccessToken = accessTokenProvider.getToken() ?: throw IdentityServiceError.NoIdentityServerConfigured

invites.map {
Expand Down

0 comments on commit f261f8f

Please sign in to comment.