Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
url encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
senia-psm committed Sep 6, 2023
1 parent 8a962e5 commit c937c89
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/clients/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,16 +271,17 @@ impl<C: golem_client::instance::Instance + Send + Sync> WorkerClient for WorkerC
template_id: RawTemplateId,
auth: &CloudAuthentication,
) -> Result<(), GolemError> {
let mut base_url = self.base_url.clone();
base_url
.set_scheme("wss")
let mut url = self.base_url.clone();
url.set_scheme("wss")
.map_err(|_| GolemError("Can't set schema.".to_string()))?;
let url = base_url
.join(&format!(
"/v1/templates/{}/workers/{}/connect",
template_id.0, name.0
))
.map_err(|e| GolemError(format!("Failed to join url: {e:>}")))?;
url.path_segments_mut()
.map_err(|_| GolemError("Can't get path.".to_string()))?
.push("v1")
.push("templates")
.push(&template_id.0.to_string())
.push("workers")
.push(&name.0)
.push("connect");

let mut request = url
.into_client_request()
Expand Down

0 comments on commit c937c89

Please sign in to comment.