mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-17 04:20:00 +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(
|
return getWellknownTask.execute(
|
||||||
GetWellknownTask.Params(
|
GetWellknownTask.Params(
|
||||||
domain = matrixId.getDomain(),
|
domain = matrixId.getDomain().substringBeforeLast(":"),
|
||||||
homeServerConnectionConfig = homeServerConnectionConfig.orWellKnownDefaults()
|
homeServerConnectionConfig = homeServerConnectionConfig.orWellKnownDefaults()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -93,10 +93,14 @@ internal class DefaultGetHomeServerCapabilitiesTask @Inject constructor(
|
||||||
}
|
}
|
||||||
}.getOrNull()
|
}.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 {
|
val wellknownResult = runCatching {
|
||||||
getWellknownTask.execute(
|
getWellknownTask.execute(
|
||||||
GetWellknownTask.Params(
|
GetWellknownTask.Params(
|
||||||
domain = userId.getDomain(),
|
domain = userId.getDomain().substringBeforeLast(":"),
|
||||||
homeServerConnectionConfig = homeServerConnectionConfig
|
homeServerConnectionConfig = homeServerConnectionConfig
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue