diff --git a/dap-lib/src/constants.rs b/dap-lib/src/constants.rs index da56e53..996ccda 100644 --- a/dap-lib/src/constants.rs +++ b/dap-lib/src/constants.rs @@ -49,6 +49,9 @@ pub const MAX_CACHE_SIZE: usize = 16384; /////////////////////////////// // Cannot override below by config.toml +/// HTTP User-Agent +pub const HTTP_USER_AGENT: &str = "doh-auth-proxy"; + // ODoH /// ODoH config path diff --git a/dap-lib/src/http_client/http_client_main.rs b/dap-lib/src/http_client/http_client_main.rs index bd62a96..ab622fc 100644 --- a/dap-lib/src/http_client/http_client_main.rs +++ b/dap-lib/src/http_client/http_client_main.rs @@ -1,4 +1,5 @@ use crate::{ + constants::HTTP_USER_AGENT, error::*, trait_resolve_ips::{resolve_ips, ResolveIpResponse, ResolveIps}, }; @@ -87,7 +88,7 @@ impl HttpClientInner { resolved_ips: &[ResolveIpResponse], ) -> Result { let mut client = Client::builder() - .user_agent(format!("{}/{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"))) + .user_agent(format!("{}/{}", HTTP_USER_AGENT, env!("CARGO_PKG_VERSION"))) .timeout(timeout_sec) .trust_dns(true);