From cdcea135a1995f594a780959d231fcac876e0a16 Mon Sep 17 00:00:00 2001 From: Kumar Shivendu Date: Tue, 16 Dec 2025 04:46:30 +0530 Subject: [PATCH] urlencode collection_name on calling partial snapshot create API (#7782) --- Cargo.lock | 1 + Cargo.toml | 1 + src/actix/api/snapshot_api.rs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index d5c69fd2fc..060be04c79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5241,6 +5241,7 @@ dependencies = [ "tracing-log", "tracing-subscriber", "tracing-tracy", + "urlencoding", "uuid", "validator", "wal", diff --git a/Cargo.toml b/Cargo.toml index 3839c65f2e..bfccf74eda 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,6 +74,7 @@ sys-info = "0.9.1" wal = { workspace = true } ordered-float = { workspace = true } ahash = { workspace = true } +urlencoding = { workspace = true } config = { version = "0.15.13", default-features = false, features = ["yaml"] } diff --git a/src/actix/api/snapshot_api.rs b/src/actix/api/snapshot_api.rs index 5094933fa4..fd59c50c99 100644 --- a/src/actix/api/snapshot_api.rs +++ b/src/actix/api/snapshot_api.rs @@ -734,8 +734,9 @@ async fn recover_partial_snapshot_from( let http_client = http_client.client(api_key.as_deref())?; + let encoded_collection_name = urlencoding::encode(&collection_name); let create_snapshot_url = format!( - "{peer_url}/collections/{collection_name}/shards/{shard_id}/snapshot/partial/create" + "{peer_url}/collections/{encoded_collection_name}/shards/{shard_id}/snapshot/partial/create" ); let snapshot_manifest = collection.get_partial_snapshot_manifest(shard_id).await?;