Update http_client.rs

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-12-12 16:39:44 -03:00
parent ea3aa1413f
commit 90599c2e7c

View file

@ -19,12 +19,13 @@ impl BotServerClient {
/// Create new botserver HTTP client /// Create new botserver HTTP client
pub fn new(base_url: Option<String>) -> Self { pub fn new(base_url: Option<String>) -> Self {
let url = base_url.unwrap_or_else(|| { let url = base_url.unwrap_or_else(|| {
std::env::var("BOTSERVER_URL").unwrap_or_else(|_| "http://localhost:8080".to_string()) std::env::var("BOTSERVER_URL").unwrap_or_else(|_| "https://localhost:8088".to_string())
}); });
let client = reqwest::Client::builder() let client = reqwest::Client::builder()
.timeout(Duration::from_secs(30)) .timeout(Duration::from_secs(30))
.user_agent(format!("BotLib/{}", env!("CARGO_PKG_VERSION"))) .user_agent(format!("BotLib/{}", env!("CARGO_PKG_VERSION")))
.danger_accept_invalid_certs(true) // Accept self-signed certs for local dev
.build() .build()
.expect("Failed to create HTTP client"); .expect("Failed to create HTTP client");