From b74696adbad1c213b0b9a3e8be4dd87628e2a105 Mon Sep 17 00:00:00 2001
From: GyDi <segydi@foxmail.com>
Date: Tue, 12 Apr 2022 01:05:51 +0800
Subject: [PATCH] feat: add default user agent

---
 src-tauri/src/core/profiles.rs | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src-tauri/src/core/profiles.rs b/src-tauri/src/core/profiles.rs
index c84eb71..1955526 100644
--- a/src-tauri/src/core/profiles.rs
+++ b/src-tauri/src/core/profiles.rs
@@ -196,9 +196,8 @@ impl PrfItem {
     if !with_proxy {
       builder = builder.no_proxy();
     }
-    if let Some(user_agent) = user_agent {
-      builder = builder.user_agent(user_agent);
-    }
+
+    builder = builder.user_agent(user_agent.unwrap_or("clash-verge/v0.1.0".into()));
 
     let resp = builder.build()?.get(url).send().await?;
     let header = resp.headers();
-- 
GitLab