Skip to content

Commit

Permalink
Make client work with libsql:// schema again
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Jastrzebski <[email protected]>
  • Loading branch information
Piotr Jastrzebski committed Feb 25, 2025
1 parent 7058bff commit e9871a2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libsql/src/database/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,14 @@ cfg_replication! {
let client = hyper::client::Client::builder()
.build::<_, hyper::Body>(connector.clone());

let req = http::Request::get(format!("{url}/sync/0/0/0"))
let prefix = if url.starts_with("libsql://") {
let mut result = "https://".to_string();
result.push_str(&url["libsql://".len()..]);
result
} else {
url.to_string()
};
let req = http::Request::get(format!("{prefix}/sync/0/0/0"))
.header("Authorization", format!("Bearer {}", auth_token))
.body(hyper::Body::empty())
.unwrap();
Expand Down

0 comments on commit e9871a2

Please sign in to comment.