diff --git a/Cargo.lock b/Cargo.lock index 5a3f969..74173ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1807,6 +1807,7 @@ dependencies = [ "http 1.1.0", "httparse", "log", + "native-tls", "rand", "sha1", "thiserror", diff --git a/Cargo.toml b/Cargo.toml index 9d9351d..026bc2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,5 +27,7 @@ term = "0.7.0" thiserror = "1.0.48" tiny_http = "0.12.0" tracing = "0.1.37" -tungstenite = { git = "https://github.com/snapview/tungstenite-rs", rev = "0fa4197" } +tungstenite = { git = "https://github.com/snapview/tungstenite-rs", rev = "0fa4197", features = [ + "native-tls", +] } url = "2.5.0" diff --git a/src/commands/services.rs b/src/commands/services.rs index 89a6ca9..faa81ab 100644 --- a/src/commands/services.rs +++ b/src/commands/services.rs @@ -10,6 +10,7 @@ use std::io::Write; use std::path::Path; use tabled::Table; use tungstenite::connect; +use tungstenite::http::Uri; use tungstenite::ClientRequestBuilder; use crate::{ @@ -400,16 +401,20 @@ impl Logs { .ok_or_else(|| anyhow!("No token found. Please login first."))?; let manifest = self.read_manifest()?; - - let logurl: tungstenite::http::Uri = format!( - "{}/orgs/{}/envs/{}/svcs/{}/logs", - base.user_config().get_url().replace("http", "ws"), - org_name, - manifest.environment, - manifest.service.name, + let logurl: Uri = url::Url::parse( + format!( + "{}/orgs/{}/envs/{}/svcs/{}/logs", + base.user_config().get_url().replace("http", "ws"), + org_name, + manifest.environment, + manifest.service.name, + ) + .as_str(), ) + .unwrap() + .as_str() .parse() - .expect("Could not parse url"); + .unwrap(); let builder = ClientRequestBuilder::new(logurl) .with_header("Authorization", format!("Bearer {}", token.to_owned()));