Skip to content

Commit 9b04f1d

Browse files
authored
Merge pull request #1966 from tursodatabase/fix_libsql_schema
Make client work with libsql:// schema again
2 parents 7058bff + e9871a2 commit 9b04f1d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

libsql/src/database/builder.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,14 @@ cfg_replication! {
366366
let client = hyper::client::Client::builder()
367367
.build::<_, hyper::Body>(connector.clone());
368368

369-
let req = http::Request::get(format!("{url}/sync/0/0/0"))
369+
let prefix = if url.starts_with("libsql://") {
370+
let mut result = "https://".to_string();
371+
result.push_str(&url["libsql://".len()..]);
372+
result
373+
} else {
374+
url.to_string()
375+
};
376+
let req = http::Request::get(format!("{prefix}/sync/0/0/0"))
370377
.header("Authorization", format!("Bearer {}", auth_token))
371378
.body(hyper::Body::empty())
372379
.unwrap();

0 commit comments

Comments
 (0)