Skip to content

Commit e9871a2

Browse files
author
Piotr Jastrzebski
committed
Make client work with libsql:// schema again
Signed-off-by: Piotr Jastrzebski <[email protected]>
1 parent 7058bff commit e9871a2

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)