diff --git a/changelog.d/2261.bugfix b/changelog.d/2261.bugfix new file mode 100644 index 000000000..63b1f337d --- /dev/null +++ b/changelog.d/2261.bugfix @@ -0,0 +1 @@ +Fixed push gateway URLs containing the configured notification path outside of their suffix. Contributed by @eleboucher. diff --git a/conduwuit-example.toml b/conduwuit-example.toml index ca4e1611f..6b740ef6c 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -1392,15 +1392,9 @@ # #emergency_password = -# Specifies the path where push notifications will be sent to a -# push gateway. -# -# When a Matrix client registers for push notifications, it will specify -# a push gateway url where notification events will be sent. -# According to the current spec for Matrix Push Gateways, the path should -# always be "/_matrix/push/v1/notify". -# You should only change this if you have configured your own push gateway -# that requires a different path. +# Suffix stripped from the end of a pusher URL before appending +# "/_matrix/push/v1/notify". Only change this if your pushers register +# URLs ending in a different path. # # For more information on Push Gateways: https://spec.matrix.org/latest/push-gateway-api/ # diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs index d2283fc26..36baee18d 100644 --- a/src/core/config/mod.rs +++ b/src/core/config/mod.rs @@ -1654,15 +1654,9 @@ pub struct Config { /// display: sensitive pub emergency_password: Option, - /// Specifies the path where push notifications will be sent to a - /// push gateway. - /// - /// When a Matrix client registers for push notifications, it will specify - /// a push gateway url where notification events will be sent. - /// According to the current spec for Matrix Push Gateways, the path should - /// always be "/_matrix/push/v1/notify". - /// You should only change this if you have configured your own push gateway - /// that requires a different path. + /// Suffix stripped from the end of a pusher URL before appending + /// "/_matrix/push/v1/notify". Only change this if your pushers register + /// URLs ending in a different path. /// /// For more information on Push Gateways: https://spec.matrix.org/latest/push-gateway-api/ /// diff --git a/src/service/pusher/mod.rs b/src/service/pusher/mod.rs index eacabe55b..1dd51495a 100644 --- a/src/service/pusher/mod.rs +++ b/src/service/pusher/mod.rs @@ -304,11 +304,13 @@ pub async fn send_request(&self, dest: &str, request: T) -> Result(&dest, (), ()) + .try_into_http_request::(dest, (), ()) .map_err(|e| { err!(BadServerResponse(warn!( "Failed to find destination {dest} for push gateway: {e}"