Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src-tauri/src/modules/codebuddy_cn_oauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,15 @@ fn generate_login_id() -> String {
)
}

/// The billing gateway rejects requests without a User-Agent header with
/// HTTP 403 / code=10085 ("请求不合法,请检查请求系统头"), while `reqwest`
/// sends none by default. Any non-empty UA passes the gateway check.
const UA: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 \
(KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36";

fn build_client() -> Result<reqwest::Client, String> {
reqwest::Client::builder()
.user_agent(UA)
.timeout(std::time::Duration::from_secs(30))
.build()
.map_err(|e| format!("创建 HTTP 客户端失败: {}", e))
Expand Down
7 changes: 7 additions & 0 deletions src-tauri/src/modules/codebuddy_oauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ fn generate_login_id() -> String {
)
}

/// The billing gateway rejects requests without a User-Agent header with
/// HTTP 403 / code=10085 ("请求不合法,请检查请求系统头"), while `reqwest`
/// sends none by default. Any non-empty UA passes the gateway check.
const UA: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 \
(KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36";

fn build_client() -> Result<reqwest::Client, String> {
reqwest::Client::builder()
.user_agent(UA)
.timeout(std::time::Duration::from_secs(30))
.build()
.map_err(|e| format!("创建 HTTP 客户端失败: {}", e))
Expand Down
7 changes: 7 additions & 0 deletions src-tauri/src/modules/workbuddy_oauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ fn generate_login_id() -> String {
)
}

/// The billing gateway rejects requests without a User-Agent header with
/// HTTP 403 / code=10085 ("请求不合法,请检查请求系统头"), while `reqwest`
/// sends none by default. Any non-empty UA passes the gateway check.
const UA: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 \
(KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36";

fn build_client() -> Result<reqwest::Client, String> {
reqwest::Client::builder()
.user_agent(UA)
.timeout(std::time::Duration::from_secs(30))
.build()
.map_err(|e| format!("创建 HTTP 客户端失败:{}", e))
Expand Down
Loading