icebear0828 Claude Opus 4.6 commited on
Commit
b0a4fb7
·
1 Parent(s): 59d671c

fix: let curl auto-negotiate Accept-Encoding for OAuth requests

Browse files

Remove the explicit Accept-Encoding header from curl-fetch.ts (used by
OAuth and appcast requests only) and let --compressed auto-negotiate
based on curl's actual decompression capabilities. This prevents
error 61 on builds where curl lacks brotli/zstd support.

Previously, the override only applied when !isImpersonate(), missing
cases where curl-impersonate was available but lacked br/zstd libs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. src/tls/curl-fetch.ts +6 -6
src/tls/curl-fetch.ts CHANGED
@@ -31,9 +31,9 @@ export async function curlFetchGet(
31
  ): Promise<CurlFetchResponse> {
32
  const transport = getTransport();
33
  const headers = buildAnonymousHeaders();
34
- if (!transport.isImpersonate()) {
35
- headers["Accept-Encoding"] = "gzip, deflate";
36
- }
37
 
38
  const result = await transport.get(url, headers, 30, options?.proxyUrl);
39
  return {
@@ -54,9 +54,9 @@ export async function curlFetchPost(
54
  ): Promise<CurlFetchResponse> {
55
  const transport = getTransport();
56
  const headers = buildAnonymousHeaders();
57
- if (!transport.isImpersonate()) {
58
- headers["Accept-Encoding"] = "gzip, deflate";
59
- }
60
  headers["Content-Type"] = contentType;
61
 
62
  const result = await transport.simplePost(url, headers, body, 30, options?.proxyUrl);
 
31
  ): Promise<CurlFetchResponse> {
32
  const transport = getTransport();
33
  const headers = buildAnonymousHeaders();
34
+ // Let --compressed auto-negotiate Accept-Encoding based on curl's actual
35
+ // decompression capabilities, avoiding error 61 on builds lacking br/zstd.
36
+ delete headers["Accept-Encoding"];
37
 
38
  const result = await transport.get(url, headers, 30, options?.proxyUrl);
39
  return {
 
54
  ): Promise<CurlFetchResponse> {
55
  const transport = getTransport();
56
  const headers = buildAnonymousHeaders();
57
+ // Let --compressed auto-negotiate Accept-Encoding based on curl's actual
58
+ // decompression capabilities, avoiding error 61 on builds lacking br/zstd.
59
+ delete headers["Accept-Encoding"];
60
  headers["Content-Type"] = contentType;
61
 
62
  const result = await transport.simplePost(url, headers, body, 30, options?.proxyUrl);