From 7fd6c6720934864ca31e08df97bf7eb9a4f49ee8 Mon Sep 17 00:00:00 2001 From: bowen628 Date: Tue, 17 Mar 2026 18:06:29 +0800 Subject: [PATCH] feat(ai): add X-Verification-Code header for openbitfun.com requests Co-Authored-By: Claude Sonnet 4.6 --- src/crates/core/src/infrastructure/ai/client.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/crates/core/src/infrastructure/ai/client.rs b/src/crates/core/src/infrastructure/ai/client.rs index 6bfacb81..dd5faa33 100644 --- a/src/crates/core/src/infrastructure/ai/client.rs +++ b/src/crates/core/src/infrastructure/ai/client.rs @@ -572,6 +572,10 @@ impl AIClient { .header("Content-Type", "application/json") .header("Authorization", format!("Bearer {}", self.config.api_key)); + if self.config.base_url.contains("openbitfun.com") { + builder = builder.header("X-Verification-Code", "from_bitfun"); + } + if has_custom_headers && is_merge_mode { builder = self.apply_custom_headers(builder); } @@ -606,6 +610,10 @@ impl AIClient { .header("anthropic-version", "2023-06-01"); } + if url.contains("openbitfun.com") { + builder = builder.header("X-Verification-Code", "from_bitfun"); + } + if has_custom_headers && is_merge_mode { builder = self.apply_custom_headers(builder); } @@ -637,6 +645,10 @@ impl AIClient { format!("Bearer {}", self.config.api_key), ); + if self.config.base_url.contains("openbitfun.com") { + builder = builder.header("X-Verification-Code", "from_bitfun"); + } + if has_custom_headers && is_merge_mode { builder = self.apply_custom_headers(builder); }