From aa9975133e1d8a816d1ffd7783dba807cc4c81fb Mon Sep 17 00:00:00 2001 From: G8XSU <3442979+G8XSU@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:09:53 +0900 Subject: [PATCH 1/2] Add suggestions/error-context clap features. It is helpful in case of wrong input by user. --- cli/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 080c3c59..a8f9df75 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -5,6 +5,6 @@ edition = "2021" [dependencies] client = { path = "../client" } -clap = { version = "4.0.5", default-features = false, features = ["derive", "std"] } +clap = { version = "4.0.5", default-features = false, features = ["derive", "std", "error-context", "suggestions", "help"] } tokio = { version = "1.38.0", default-features = false, features = ["rt-multi-thread", "macros"] } prost = { version = "0.11.6", default-features = false} From 26a4ca340deea60e6a2c6484fd216f44f6199b4c Mon Sep 17 00:00:00 2001 From: G8XSU <3442979+G8XSU@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:14:03 +0900 Subject: [PATCH 2/2] Exclude '/' from path pattern matching. --- server/src/service.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/service.rs b/server/src/service.rs index ef4aa251..5f1f8f7b 100644 --- a/server/src/service.rs +++ b/server/src/service.rs @@ -46,7 +46,8 @@ impl Service> for NodeService { fn call(&self, req: Request) -> Self::Future { let node = Arc::clone(&self.node); - match req.uri().path() { + // Exclude '/' from path pattern matching. + match &req.uri().path()[1..] { ONCHAIN_RECEIVE_PATH => { Box::pin(handle_request(node, req, handle_onchain_receive_request)) },