Fix paths generated from origin (#3372)

These mistakenly doubled the initial `/` character. This was broken in #3361.
This commit is contained in:
Dustin J. Mitchell 2024-04-16 22:05:45 -04:00 committed by GitHub
parent 0944c73716
commit f86a069faf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -94,10 +94,7 @@ impl Server for SyncServer {
parent_version_id: VersionId,
history_segment: HistorySegment,
) -> Result<(AddVersionResult, SnapshotUrgency)> {
let url = format!(
"{}/v1/client/add-version/{}",
self.origin, parent_version_id
);
let url = format!("{}v1/client/add-version/{}", self.origin, parent_version_id);
let unsealed = Unsealed {
version_id: parent_version_id,
payload: history_segment,
@ -130,7 +127,7 @@ impl Server for SyncServer {
fn get_child_version(&mut self, parent_version_id: VersionId) -> Result<GetVersionResult> {
let url = format!(
"{}/v1/client/get-child-version/{}",
"{}v1/client/get-child-version/{}",
self.origin, parent_version_id
);
match self
@ -159,7 +156,7 @@ impl Server for SyncServer {
}
fn add_snapshot(&mut self, version_id: VersionId, snapshot: Snapshot) -> Result<()> {
let url = format!("{}/v1/client/add-snapshot/{}", self.origin, version_id);
let url = format!("{}v1/client/add-snapshot/{}", self.origin, version_id);
let unsealed = Unsealed {
version_id,
payload: snapshot,
@ -175,7 +172,7 @@ impl Server for SyncServer {
}
fn get_snapshot(&mut self) -> Result<Option<(VersionId, Snapshot)>> {
let url = format!("{}/v1/client/snapshot", self.origin);
let url = format!("{}v1/client/snapshot", self.origin);
match self
.agent
.get(&url)