diff options
Diffstat (limited to 'src/requests/start.rs')
-rw-r--r-- | src/requests/start.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/requests/start.rs b/src/requests/start.rs index 3afbe3a..1ec3ce8 100644 --- a/src/requests/start.rs +++ b/src/requests/start.rs | |||
@@ -17,12 +17,12 @@ pub async fn start(config: &Config, id: String, ping: bool) -> Result<(), Error> | |||
17 | let send_start = MultiProgress::new(); | 17 | let send_start = MultiProgress::new(); |
18 | let overview = add_pb(&send_start, OVERVIEW_STYLE, format!(") start {id}")); | 18 | let overview = add_pb(&send_start, OVERVIEW_STYLE, format!(") start {id}")); |
19 | 19 | ||
20 | let url = format_url(config, "start", &Protocols::Http); | 20 | let url = format_url(config, "start", &Protocols::Http, Some(&id)); |
21 | let connect = add_pb(&send_start, DEFAULT_STYLE, format!("connect to {url}")); | 21 | let connect = add_pb(&send_start, DEFAULT_STYLE, format!("connect to {url}")); |
22 | let res = reqwest::Client::new() | 22 | let res = reqwest::Client::new() |
23 | .post(url) | 23 | .post(url) |
24 | .headers(default_headers(config)?) | 24 | .headers(default_headers(config)?) |
25 | .body(format!(r#"{{"id": "{id}", "ping": {ping}}}"#)) | 25 | .body(format!(r#"{{"ping": {ping}}}"#)) |
26 | .send() | 26 | .send() |
27 | .await?; | 27 | .await?; |
28 | finish_pb(&connect, "connected, got response".to_string(), DONE_STYLE); | 28 | finish_pb(&connect, "connected, got response".to_string(), DONE_STYLE); |
@@ -71,8 +71,8 @@ async fn status_socket( | |||
71 | let ws_pb = add_pb(pb, DEFAULT_STYLE, "connect to websocket".to_string()); | 71 | let ws_pb = add_pb(pb, DEFAULT_STYLE, "connect to websocket".to_string()); |
72 | 72 | ||
73 | let request = Request::builder() | 73 | let request = Request::builder() |
74 | .uri(format_url(config, "status", &Protocols::Websocket)) | 74 | .uri(format_url(config, "status", &Protocols::Websocket, None)) |
75 | .header("Authorization", &config.apikey) | 75 | .header("Authorization", &config.auth.secret) |
76 | .header("sec-websocket-key", "") | 76 | .header("sec-websocket-key", "") |
77 | .header("host", &config.server) | 77 | .header("host", &config.server) |
78 | .header("upgrade", "websocket") | 78 | .header("upgrade", "websocket") |