Skip to content

Commit

Permalink
fix: user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
junkurihara committed Nov 15, 2023
1 parent 9abfca9 commit 89b41f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dap-lib/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion dap-lib/src/http_client/http_client_main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{
constants::HTTP_USER_AGENT,
error::*,
trait_resolve_ips::{resolve_ips, ResolveIpResponse, ResolveIps},
};
Expand Down Expand Up @@ -87,7 +88,7 @@ impl HttpClientInner {
resolved_ips: &[ResolveIpResponse],
) -> Result<Self> {
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);

Expand Down

0 comments on commit 89b41f1

Please sign in to comment.