这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@KawaiiZapic
Copy link
Contributor

@KawaiiZapic KawaiiZapic commented Sep 8, 2025

Setting CURLOPT_ACCEPT_ENCODING to an empty string will enable compressing and decompressing of cURL, which will:

  1. Automatically compress the request body and request server respond with a compressed body to reduce network traffic.
  2. Automatically decompress the response body according to the content-encoding header in the response.
  3. Make curl decompressing response body automatically when users set the accept-encoding header manually (some SDKs sign requests with headers, making deleting the accept-encoding header impossible).

Without setting CURLOPT_ACCEPT_ENCODING, cURL will not decompress any response even a content-encoding header is set, enforcing users handle decompressing in JS with a poor performance.

@saghul saghul merged commit 7ebf62b into saghul:master Sep 8, 2025
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants