fix: force identity encoding for claude messages

This commit is contained in:
ciat-777
2026-03-21 12:48:34 +08:00
parent 9007ca7ea7
commit 1b78359739
4 changed files with 5 additions and 4 deletions
@@ -83,7 +83,7 @@ function buildClaudeRuntimeHeaders(input: {
'User-Agent': getInputHeader(input.claudeHeaders, 'user-agent') || CLAUDE_DEFAULT_USER_AGENT,
Connection: 'keep-alive',
Accept: input.stream ? 'text/event-stream' : 'application/json',
'Accept-Encoding': input.stream ? 'identity' : 'gzip, deflate, br, zstd',
'Accept-Encoding': 'identity',
};
if (input.isClaudeOauthUpstream) {
headers.Authorization = `Bearer ${input.tokenValue}`;
@@ -70,6 +70,7 @@ describe('resolveProviderProfile', () => {
expect(result.headers.Authorization).toBe('Bearer oauth-access-token');
expect(result.headers['x-api-key']).toBeUndefined();
expect(result.headers['anthropic-version']).toBe('2023-06-01');
expect(result.headers['Accept-Encoding']).toBe('identity');
expect(result.runtime).toMatchObject({
executor: 'claude',
modelName: 'claude-opus-4-6',