hardening: isolate third-party paths and clean external-build metadata (#311)

* hardening: isolate third-party paths and clean external-build metadata

* fix: restore external feedback flow and make privacy check portable
This commit is contained in:
KRATOS
2026-04-04 11:52:33 +05:30
committed by GitHub
parent cdbe016e6f
commit 27e6505bfd
18 changed files with 367 additions and 59 deletions

View File

@@ -10,6 +10,7 @@ import {
handleOAuth401Error,
isClaudeAISubscriber,
} from './auth.js'
import { getAPIProvider } from './model/providers.js'
import { getClaudeCodeUserAgent } from './userAgent.js'
import { getWorkload } from './workloadContext.js'
@@ -54,7 +55,11 @@ export function getMCPUserAgent(): string {
// operators match in robots.txt); the claude-code suffix lets them distinguish
// local CLI traffic from claude.ai server-side fetches.
export function getWebFetchUserAgent(): string {
return `Claude-User (${getClaudeCodeUserAgent()}; +https://support.anthropic.com/)`
const supportUrl =
getAPIProvider() === 'firstParty'
? 'https://support.anthropic.com/'
: 'https://github.com/Gitlawb/openclaude'
return `Claude-User (${getClaudeCodeUserAgent()}; +${supportUrl})`
}
export type AuthHeaders = {