Skip to content

Commit 9f1cc50

Browse files
authored
Send encryption key, if available, during sync probe (#2124)
2 parents 3e6b5cc + c6b7c13 commit 9f1cc50

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

libsql/src/database/builder.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,14 @@ cfg_replication! {
399399
url.to_string()
400400
};
401401
let req = http::Request::get(format!("{prefix}/info"))
402-
.header("Authorization", format!("Bearer {}", auth_token))
403-
.body(hyper::Body::empty())
404-
.unwrap();
402+
.header("Authorization", format!("Bearer {}", auth_token));
403+
404+
let req = if let Some(ref remote_encryption) = remote_encryption {
405+
req.header("x-turso-encryption-key", remote_encryption.key.as_string())
406+
} else {
407+
req
408+
};
409+
let req = req.body(hyper::Body::empty()).unwrap();
405410

406411
let res = client
407412
.request(req)

0 commit comments

Comments
 (0)