feat: support hosting .well-known from Conduit

Co-authored-by: Matthias Ahouansou <matthias@ahouansou.cz>
This commit is contained in:
Jakub Kubík 2024-05-02 09:26:43 +01:00 committed by Matthias Ahouansou
parent b4a60c3f9a
commit c1f695653b
No known key found for this signature in database
10 changed files with 101 additions and 23 deletions

View file

@ -0,0 +1,22 @@
use ruma::api::client::discovery::discover_homeserver::{
self, HomeserverInfo, SlidingSyncProxyInfo,
};
use crate::{services, Result, Ruma};
/// # `GET /.well-known/matrix/client`
///
/// Returns the client server discovery information.
pub async fn well_known_client(
_body: Ruma<discover_homeserver::Request>,
) -> Result<discover_homeserver::Response> {
let client_url = services().globals.well_known_client();
Ok(discover_homeserver::Response {
homeserver: HomeserverInfo {
base_url: client_url.clone(),
},
identity_server: None,
sliding_sync_proxy: Some(SlidingSyncProxyInfo { url: client_url }),
})
}