From f19f312d6f492f96e1262bc2f104b864cb836749 Mon Sep 17 00:00:00 2001 From: LightQuantum Date: Wed, 31 May 2023 20:52:12 +0800 Subject: [PATCH] fix: routes with common prefixes may override each other --- rsync-gateway/src/app.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rsync-gateway/src/app.rs b/rsync-gateway/src/app.rs index 31595b4..6a57879 100644 --- a/rsync-gateway/src/app.rs +++ b/rsync-gateway/src/app.rs @@ -11,7 +11,7 @@ use crate::state::{listen_for_updates, State}; pub async fn configure(opts: &Opts) -> Result { let prefix_state: Arc> = Arc::new( - future::try_join_all(opts.endpoints.iter().map(|(prefix, endpoint)| async { + future::try_join_all(opts.endpoints.iter().rev().map(|(prefix, endpoint)| async { let prefix = prefix.trim_end_matches('/').to_string(); let redis = redis::Client::open(endpoint.redis.clone())?; let conn = redis.get_multiplexed_tokio_connection().await?;