diff options
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/common.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/client/common.rs b/src/client/common.rs index 1275d0b..9c516c8 100644 --- a/src/client/common.rs +++ b/src/client/common.rs @@ -43,6 +43,9 @@ pub trait Client: Sync + Send { let timeout = extra.and_then(|v| v.connect_timeout).unwrap_or(10); let proxy = extra.and_then(|v| v.proxy.clone()); builder = set_proxy(builder, proxy.as_ref())?; + if let Some(user_agent) = self.global_config().read().user_agent.as_ref() { + builder = builder.user_agent(user_agent); + } let client = builder .connect_timeout(Duration::from_secs(timeout)) .build() |
