Bug #79097 [NEW]: when set CURLOPT_ENCODING "gzip", can't get raw data responsed
| From: | 839325966 at qq dot com | Date: | Sat, 11 Jan 2020 03:16:22 +0000 |
| Subject: | Bug #79097 [NEW]: when set CURLOPT_ENCODING "gzip", can't get raw data responsed | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-224840@lists.php.net to get a copy of this message | ||
From: 839325966 at qq dot com
Operating system: centos 7.7
PHP version: 7.2.26
Package: cURL related
Bug Type: Bug
Bug description:when set CURLOPT_ENCODING "gzip", can't get raw data responsed
Description:
------------
when set CURLOPT_ENCODING "gzip", can't get raw data responsed.
Test script:
---------------
<?php
$url = "https://bugs.php.net/report.php";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_ENCODING, 'gzip, deflate');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
$responseBody = curl_exec($curl);
$headerArray = curl_getinfo($curl);
if (strlen($responseBody) != $headerArray['size_download'])
{
printf("error, response data length:%d, download size:%d\n",
strlen($responseBody), $headerArray['size_download']);
}
Expected result:
----------------
reuse CURLOPT_BINARYTRANSFER suggest
--
Edit bug report at https://bugs.php.net/bug.php?id=79097&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79097&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79097&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79097&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79097&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79097&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79097&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79097&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79097&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79097&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79097&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79097&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79097&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79097&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79097&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79097&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79097&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79097&r=mysqlcfg