From 50431b7ec93808e6c97c2f0199240a106e61777d Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 16 Apr 2026 23:55:09 +0800 Subject: [PATCH] feat(usage-script): add User-Agent header to New API template Align the New API usage query template with the GENERAL template by including "User-Agent: cc-switch/1.0" in its request headers, so cc-switch requests are identifiable in provider server logs and less likely to be blocked by UA-based rate limiting on some New API deployments. --- src/components/UsageScriptModal.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/UsageScriptModal.tsx b/src/components/UsageScriptModal.tsx index a0d33b077..3acfcaba9 100644 --- a/src/components/UsageScriptModal.tsx +++ b/src/components/UsageScriptModal.tsx @@ -73,6 +73,7 @@ const generatePresetTemplates = ( headers: { "Content-Type": "application/json", "Authorization": "Bearer {{accessToken}}", + "User-Agent": "cc-switch/1.0", "New-Api-User": "{{userId}}" }, },