Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
jfullerton44 committed Oct 17, 2024
1 parent f310ea4 commit ee255ee
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rs/src/contracts/tunnel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// Licensed under the MIT license.
// Generated from ../../../cs/src/Contracts/Tunnel.cs

use chrono::{DateTime, Utc};
use crate::contracts::TunnelAccessControl;
use crate::contracts::TunnelEndpoint;
use crate::contracts::TunnelOptions;
use crate::contracts::TunnelPort;
use crate::contracts::TunnelStatus;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

Expand Down
2 changes: 1 addition & 1 deletion rs/src/contracts/tunnel_access_control_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the MIT license.
// Generated from ../../../cs/src/Contracts/TunnelAccessControlEntry.cs

use chrono::{DateTime, Utc};
use crate::contracts::TunnelAccessControlEntryType;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

// Data contract for an access control entry on a `Tunnel` or `TunnelPort`.
Expand Down
2 changes: 1 addition & 1 deletion rs/src/contracts/tunnel_port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub struct TunnelPort {
// A client that connects to a tunnel (by ID or name) without specifying a port number
// will connect to the default port for the tunnel, if a default is configured. Or if
// the tunnel has only one port then the single port is the implicit default.
//
//
// Selection of a default port for a connection also depends on matching the
// connection to the port `TunnelPort.Protocol`, so it is possible to configure
// separate defaults for distinct protocols like `TunnelProtocol.Http` and
Expand Down
23 changes: 19 additions & 4 deletions rs/src/management/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ impl TunnelManagementClient {
) -> HttpResult<TunnelEndpoint> {
let mut url = self.build_tunnel_uri(
locator,
Some(&format!("{}/{}", ENDPOINTS_API_SUB_PATH, endpoint.id.as_deref().unwrap())),
Some(&format!(
"{}/{}",
ENDPOINTS_API_SUB_PATH,
endpoint.id.as_deref().unwrap()
)),
);
url.query_pairs_mut()
.append_pair("connectionMode", &endpoint.connection_mode.to_string());
Expand All @@ -180,7 +184,11 @@ impl TunnelManagementClient {
) -> HttpResult<TunnelRelayTunnelEndpoint> {
let mut url = self.build_tunnel_uri(
locator,
Some(&format!("{}/{}", ENDPOINTS_API_SUB_PATH, endpoint.base.id.as_deref().unwrap())),
Some(&format!(
"{}/{}",
ENDPOINTS_API_SUB_PATH,
endpoint.base.id.as_deref().unwrap()
)),
);
url.query_pairs_mut()
.append_pair("connectionMode", &endpoint.base.connection_mode.to_string());
Expand Down Expand Up @@ -458,8 +466,15 @@ impl TunnelManagementClient {
match get_policy_header_value() {
Ok(Some(policy_header_value)) => {
if let Ok(header_value) = HeaderValue::from_maybe_shared(policy_header_value) {
let header_value_str = header_value.to_str().unwrap().replace("%22", "").replace("%3B", ";");
headers.insert("User-Agent-Policies", HeaderValue::from_str(&header_value_str).unwrap());
let header_value_str = header_value
.to_str()
.unwrap()
.replace("%22", "")
.replace("%3B", ";");
headers.insert(
"User-Agent-Policies",
HeaderValue::from_str(&header_value_str).unwrap(),
);
log::info!("Headers: {:?}", headers);
} else {
log::error!("Invalid header value");
Expand Down

0 comments on commit ee255ee

Please sign in to comment.