From 9e3e7bdf854a464309bf0cbda2fdf882fec25886 Mon Sep 17 00:00:00 2001 From: Henry Fontanier Date: Fri, 9 Feb 2024 13:00:46 +0100 Subject: [PATCH] enh: encode URI component db id (#3661) Co-authored-by: Henry Fontanier --- core/src/sqlite_workers/client.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/sqlite_workers/client.rs b/core/src/sqlite_workers/client.rs index 5da89134e368..cbb8e0042edb 100644 --- a/core/src/sqlite_workers/client.rs +++ b/core/src/sqlite_workers/client.rs @@ -2,6 +2,7 @@ use anyhow::{anyhow, Result}; use hyper::{Body, Client, Request}; use serde::{Deserialize, Serialize}; use serde_json::json; +use urlencoding::encode; use crate::{ databases::database::{QueryResult, Table}, @@ -45,7 +46,11 @@ impl SqliteWorker { let req = Request::builder() .method("POST") - .uri(format!("{}/databases/{}", worker_url, database_unique_id)) + .uri(format!( + "{}/databases/{}", + worker_url, + encode(database_unique_id) + )) .header("Content-Type", "application/json") .body(Body::from( json!({