BigFileTools icon indicating copy to clipboard operation
BigFileTools copied to clipboard

Curl+file scheme not returns headers in PHP 7.3+

Open brcontainer opened this issue 6 years ago • 2 comments

In Curl driver headers aren't returned, example:

$ch = curl_init('file:///c:/foo/bar/baz.txt');

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);

$headers = curl_exec($ch);

curl_close($ch);

var_dump($headers);

In PHP 7.2 (and olders) returns:

string(88) "Content-Length: 57
Accept-ranges: bytes
Last-Modified: Sun, 29 Dec 2019 05:31:32 GMT
"

In PHP 7.3 and PHP 7.4 returns empty string:

string(0) ""

brcontainer avatar Jan 13 '20 02:01 brcontainer

Could you please propose a fix for this?

jkuchar avatar Jan 17 '20 15:01 jkuchar

@jkuchar my sugestion: https://github.com/jkuchar/BigFileTools/pull/27

brcontainer avatar Jan 18 '20 05:01 brcontainer