Skip to content

Commit 2fb2d75

Browse files
committed
[WARP] Use enterprise download provider when available
This allows connections to enterprise servers without requiring the default download provider to be switched in settings
1 parent d28fdef commit 2fb2d75

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

plugins/warp/src/container/network/client.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,15 @@ impl NetworkClient {
3434
if let Some(token) = &server_token {
3535
headers.push(("authorization".to_string(), format!("Bearer {}", token)));
3636
}
37+
// NOTE: Because we pull in the system certificates as well in the enterprise download provider
38+
// it is safe to assume that provider when available, so that we can connect to enterprise servers
39+
// when a client is running under an enterprise client build.
40+
let provider = DownloadProvider::get("_EnterpriseDownloadProvider").unwrap_or_else(|| {
41+
// Not running under an enterprise client, fallback to the default download provider.
42+
DownloadProvider::try_default().expect("No default download provider")
43+
});
3744
Self {
38-
provider: DownloadProvider::try_default().unwrap(),
45+
provider,
3946
headers,
4047
server_url,
4148
}

0 commit comments

Comments
 (0)