From e6a1b0b66f78d6b77f3a462d7420ae2bd2421e7f Mon Sep 17 00:00:00 2001 From: Devin Ragotzy Date: Sun, 26 Jul 2020 09:39:57 -0400 Subject: [PATCH] Add cfg_attr gate to server_server endpoints --- src/server_server.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server_server.rs b/src/server_server.rs index 99d75c4..a214143 100644 --- a/src/server_server.rs +++ b/src/server_server.rs @@ -130,14 +130,14 @@ pub async fn send_request( } } -#[get("/.well-known/matrix/server")] +#[cfg_attr(feature = "conduit_bin",get("/.well-known/matrix/server"))] pub fn well_known_server() -> Json { rocket::response::content::Json( json!({ "m.server": "matrixtesting.koesters.xyz:14004"}).to_string(), ) } -#[get("/_matrix/federation/v1/version")] +#[cfg_attr(feature = "conduit_bin",get("/_matrix/federation/v1/version"))] pub fn get_server_version() -> MatrixResult { MatrixResult(Ok(get_server_version::Response { server: Some(get_server_version::Server { @@ -147,7 +147,7 @@ pub fn get_server_version() -> MatrixResult })) } -#[get("/_matrix/key/v2/server")] +#[cfg_attr(feature = "conduit_bin",get("/_matrix/key/v2/server"))] pub fn get_server_keys(db: State<'_, Database>) -> Json { let mut verify_keys = BTreeMap::new(); verify_keys.insert( @@ -177,7 +177,7 @@ pub fn get_server_keys(db: State<'_, Database>) -> Json { Json(response.to_string()) } -#[get("/_matrix/key/v2/server/<_key_id>")] +#[cfg_attr(feature = "conduit_bin",get("/_matrix/key/v2/server/<_key_id>"))] pub fn get_server_keys_deprecated(db: State<'_, Database>, _key_id: String) -> Json { get_server_keys(db) }