Skip to content

Commit

Permalink
fixup! fixup! fix: Honor c8y.mqtt setting on tedge connect thin-edge#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Albin Suresh committed Mar 22, 2024
1 parent b414aa5 commit 845a49e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ impl<const P: u16> HostPort<P> {
pub fn port(&self) -> Port {
self.port
}

/// Returns a string representation of the host.
///
/// In practice, it just returns the input string used to construct the
/// struct.
pub fn as_str(&self) -> &str {
&self.input
}
}

impl<const P: u16> From<HostPort<P>> for String {
Expand Down
2 changes: 1 addition & 1 deletion crates/core/c8y_api/src/http_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl C8yEndPoint {

let (_, host) = url_host.split_once('.').unwrap_or((url_host, ""));
let (_, c8y_host) = tenant_uri.split_once('.').unwrap();
(host == c8y_host).then_some(url)
(c8y_host.starts_with(host)).then_some(url)
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/core/tedge/src/cli/certificate/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl UploadCertCmd {
// and therefore we need to get tenant_id.
let tenant_id = get_tenant_id_blocking(
&client,
build_get_tenant_id_url(self.host.as_str())?,
build_get_tenant_id_url(&self.host.to_string())?,
&self.username,
&password,
)?;
Expand All @@ -95,7 +95,7 @@ impl UploadCertCmd {
tenant_id: &str,
password: &str,
) -> Result<(), CertError> {
let post_url = build_upload_certificate_url(self.host.as_str(), tenant_id)?;
let post_url = build_upload_certificate_url(&self.host.to_string(), tenant_id)?;

let post_body = UploadCertBody {
auto_registration_enabled: true,
Expand Down

0 comments on commit 845a49e

Please sign in to comment.