Skip to content

Unable to set CURLOPT_ACCEPT_ENCODING to NULL #11433

Closed

Description

@gnif

Description

According to the CURL documentation (https://curl.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html) setting CURLOPT_ACCEPT_ENCODING to a null value (not an empty string) will prevent it from decompressing the returned data stream. This is desirable in a caching/proxy scenario.

Currently this is not possible as PHP will always provide a string to this value.

PHP Version

8.1.20

Operating System

Debian 11

Activity

  1. gnif commented on Jun 12, 2023

    @gnif
    Author

    I have just noticed that the default is NULL if the option is not set at all, simply providing the content-encoding header will result in the compressed content being returned in it's original form. This though IMO is still a bug as setting NULL should actually set NULL so that one doesn't have to rely on defaults that may change in the future.

  2. added 3 commits that reference this issue on Jun 12, 2023
    71ede83
    a8a3b99
    c160693
  3. added a commit that references this issue on Jun 13, 2023
    18f2f0a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions