Skip to content

Commit

Permalink
fix: don't fail command on failed version check && use rustls (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
EverlastingBugstopper authored Jun 22, 2021
1 parent 8e0666b commit 703ea5e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion crates/rover-client/src/blocking/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use reqwest::{
header::HeaderMap,
Error as ReqwestError, StatusCode,
};

use std::collections::HashMap;

/// Represents a generic GraphQL client for making http requests.
Expand All @@ -18,7 +19,10 @@ impl GraphQLClient {
/// This client is used for generic GraphQL requests, such as introspection.
pub fn new(graphql_endpoint: &str) -> Result<GraphQLClient, ReqwestError> {
Ok(GraphQLClient {
client: ReqwestClient::builder().gzip(true).build()?,
client: ReqwestClient::builder()
.use_rustls_tls()
.gzip(true)
.build()?,
graphql_endpoint: graphql_endpoint.to_string(),
})
}
Expand Down
6 changes: 5 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,13 @@ impl Rover {
// this only happens once a day automatically
// we skip this check for the `rover update` commands, since they
// do their own checks

if let Command::Update(_) = &self.command { /* skip check */
} else {
version::check_for_update(self.get_rover_config()?, false)?;
let config = self.get_rover_config();
if let Ok(config) = config {
let _ = version::check_for_update(config, false);
}
}

match &self.command {
Expand Down

0 comments on commit 703ea5e

Please sign in to comment.