From 86b4f39a75ff38816bdba68b819c6cff66863adb Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Wed, 22 Mar 2023 15:36:40 -0700 Subject: [PATCH] string hostname --- web3_proxy/src/app/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web3_proxy/src/app/mod.rs b/web3_proxy/src/app/mod.rs index d945fa2c..5ccdd5c6 100644 --- a/web3_proxy/src/app/mod.rs +++ b/web3_proxy/src/app/mod.rs @@ -44,7 +44,6 @@ use redis_rate_limiter::{redis, DeadpoolRuntime, RedisConfig, RedisPool, RedisRa use serde::Serialize; use serde_json::json; use serde_json::value::to_raw_value; -use std::ffi::OsString; use std::fmt; use std::hash::{Hash, Hasher}; use std::net::IpAddr; @@ -214,7 +213,7 @@ pub struct Web3ProxyApp { pub config: AppConfig, pub db_conn: Option, pub db_replica: Option, - pub hostname: Option, + pub hostname: Option, /// store pending transactions that we've seen so that we don't send duplicates to subscribers pub pending_transactions: Cache, pub frontend_ip_rate_limiter: Option>, @@ -696,7 +695,7 @@ impl Web3ProxyApp { Some(private_rpcs) }; - let hostname = hostname::get().ok(); + let hostname = hostname::get().ok().and_then(|x| x.to_str().map(|x| x.to_string())); let app = Self { config: top_config.app.clone(),