1--TEST--
2Test curl_setopt() with CURLOPT_ACCEPT_ENCODING
3--EXTENSIONS--
4curl
5--FILE--
6<?php
7
8include 'server.inc';
9$host = curl_cli_server_start();
10
11$ch = curl_init();
12
13$url = "{$host}/get.inc?test=";
14curl_setopt($ch, CURLOPT_URL, $url);
15curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
16curl_setopt($ch, CURLOPT_ACCEPT_ENCODING, "gzip");
17curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
18
19// First execution, with gzip accept
20curl_exec($ch);
21echo curl_getinfo($ch, CURLINFO_HEADER_OUT);
22
23// Second execution, with the encoding accept disabled
24curl_setopt($ch, CURLOPT_ACCEPT_ENCODING, NULL);
25curl_exec($ch);
26echo curl_getinfo($ch, CURLINFO_HEADER_OUT);
27
28curl_close($ch);
29?>
30--EXPECTF--
31GET /get.inc?test= HTTP/1.1
32Host: %s
33Accept: */*
34Accept-Encoding: gzip
35
36GET /get.inc?test= HTTP/1.1
37Host: %s
38Accept: */*
39