mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 17:35:54 +03:00
Well-known lookups should not include the port of a server.
This commit is contained in:
parent
738ce18a2f
commit
7efd41e17a
2 changed files with 6 additions and 2 deletions
|
@ -381,7 +381,7 @@ internal class DefaultAuthenticationService @Inject constructor(
|
|||
|
||||
return getWellknownTask.execute(
|
||||
GetWellknownTask.Params(
|
||||
domain = matrixId.getDomain(),
|
||||
domain = matrixId.getDomain().substringBeforeLast(":"),
|
||||
homeServerConnectionConfig = homeServerConnectionConfig.orWellKnownDefaults()
|
||||
)
|
||||
)
|
||||
|
|
|
@ -93,10 +93,14 @@ internal class DefaultGetHomeServerCapabilitiesTask @Inject constructor(
|
|||
}
|
||||
}.getOrNull()
|
||||
|
||||
// Domain may include a port (eg, matrix.org:8080)
|
||||
// Per https://spec.matrix.org/latest/client-server-api/#well-known-uri we should extract the hostname from the server name
|
||||
// So we take everything before the last : as the domain for the well-known task.
|
||||
// NB: This is not always the same endpoint as capabilities / mediaConfig uses.
|
||||
val wellknownResult = runCatching {
|
||||
getWellknownTask.execute(
|
||||
GetWellknownTask.Params(
|
||||
domain = userId.getDomain(),
|
||||
domain = userId.getDomain().substringBeforeLast(":"),
|
||||
homeServerConnectionConfig = homeServerConnectionConfig
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue