[fix] Urlencode when passing filenames to sqlite3 (#2655)

This commit is contained in:
Uttarayan Mondal 2023-10-18 00:14:25 +05:30 committed by GitHub
parent b16fbebf2f
commit b85b72355e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

7
Cargo.lock generated
View File

@ -3454,6 +3454,7 @@ dependencies = [
"time",
"tracing",
"url",
"urlencoding",
"uuid",
]
@ -3920,6 +3921,12 @@ dependencies = [
"percent-encoding",
]
[[package]]
name = "urlencoding"
version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
[[package]]
name = "utf8parse"
version = "0.2.1"

View File

@ -43,6 +43,7 @@ tracing = { version = "0.1.37", features = ["log"] }
serde = { version = "1.0.145", features = ["derive"], optional = true }
regex = { version = "1.5.5", optional = true }
urlencoding = "2.1.3"
[dependencies.libsqlite3-sys]
version = "0.26.0"

View File

@ -100,7 +100,11 @@ impl EstablishParams {
}
if !query_params.is_empty() {
filename = format!("file:{}?{}", filename, query_params.join("&"));
filename = format!(
"file:{}?{}",
urlencoding::encode(&filename),
query_params.join("&")
);
flags |= libsqlite3_sys::SQLITE_OPEN_URI;
}