Package: php-curl
Version: 1:7.0+49
Hello there!
I noticed using guzzle that we are unable to send a blank accept header, so
I had tested the same thing using the PHP-Curl extension.
The behavior seems to be the same; a '*/*, ' value is being sent using the
underlying 'Accept;' CURLOPT header.
The test code:
\str_replace(' ', '%20',
'https://postman-echo.com/get?foo1=bar1=bar2'),
CURLOPT_RETURNTRANSFER => true,CURLOPT_HEADER => false,
CURLOPT_FOLLOWLOCATION => true,CURLOPT_AUTOREFERER => true,
CURLOPT_CONNECTTIMEOUT => 120,CURLOPT_TIMEOUT => 120,
CURLOPT_MAXREDIRS => 10,CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_HTTPHEADER => $curlHeaders,];$options[CURLOPT_CUSTOMREQUEST] =
'GET';\curl_setopt_array($curl, $options);echo
\curl_exec($curl);\curl_close($curl);
With Dockerfile (I'm using docker to be able to quickly test this behavior
under different platforms)
FROM php:7.3-cli
COPY test.php /usr/src/myapp/test.php
WORKDIR /usr/src/myapp
CMD [ "php", "./test.php" ]
I have back-tested this, and the behavior is the same for php:7.3-cli,
php:7.2-cli, php:7.1-cli, php:7.0-cli and php:5.6-cli.
And then I tested this using the alpine based images, of which seems to
behave correctly, and the blank header is being sent accordingly.
This is a guess on my part, but at this stage I suspect that the Debian
curl extension causing this difference of behavior.