Properly deserialize well-known response

According to the spec
(https://matrix.org/docs/spec/server_server/r0.1.4#get-well-known-matrix-server),
the expected field to receive the delegated name is `m.server` instead
of `m.homeserver`.
This commit is contained in:
gnieto 2021-05-02 09:47:06 +02:00 committed by Jonas Platte
parent f940ff5d11
commit 325f2f918c
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
2 changed files with 10 additions and 5 deletions

View File

@ -11,6 +11,7 @@ Breaking Changes:
* Wrap `Pdu`s in `backfill::get_backfill` in `Raw`
* Use `ruma_identifiers::MxcUri` instead of `String` for `avatar_url` in
`query::get_profile_information::v1`
* Rename `homeserver` property to `server` on `discover_homeserver::Response`
Improvements:
@ -38,6 +39,10 @@ Improvements:
},
```
Bug fixes:
* Fixes `discover_homeserver::Response` serialization and deserialization
# 0.0.3
Breaking Changes:

View File

@ -17,9 +17,9 @@ ruma_api! {
request: {}
response: {
/// The server name to delegate server-server communciations to, with optional port.
#[serde(rename = "m.homeserver")]
pub homeserver: ServerNameBox,
/// The server name to delegate server-server communications to, with optional port.
#[serde(rename = "m.server")]
pub server: ServerNameBox,
}
}
@ -32,7 +32,7 @@ impl Request {
impl Response {
/// Creates a new `Response` with the given homeserver.
pub fn new(homeserver: ServerNameBox) -> Self {
Self { homeserver }
pub fn new(server: ServerNameBox) -> Self {
Self { server }
}
}